diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java index 84080d204e..15e4d22232 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/TagCustomerDTO.java @@ -18,12 +18,14 @@ package com.epmet.dto; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; +import java.util.List; /** @@ -54,6 +56,10 @@ public class TagCustomerDTO implements Serializable { * 标签名称 */ private String tagName; + /** + * 标签颜色 + */ + private String tagColor; /** * 使用计数 @@ -69,31 +75,41 @@ public class TagCustomerDTO implements Serializable { /** * 删除标识 0.未删除 1.已删除 */ + @JsonIgnore private Integer delFlag; /** * 乐观锁 */ + @JsonIgnore private Integer revision; /** * 创建人 */ + @JsonIgnore private String createdBy; /** * 创建时间 */ + @JsonIgnore private Date createdTime; /** * 更新人 */ + @JsonIgnore private String updatedBy; /** * 更新时间 */ + @JsonIgnore private Date updatedTime; + /** + * 应用范围 + */ + private List agencyList; } diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java index 403b30094d..d27d57e3f4 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/TagCustomerFormDTO.java @@ -47,7 +47,7 @@ public class TagCustomerFormDTO implements Serializable { /** * 应用范围,只能选社区 */ - private List agencyIds; + private List agencyList; /** * 客户ID */ diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java index 70c29ec8a2..cf3ccefc3a 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagCustomerDao.java @@ -64,4 +64,5 @@ public interface TagCustomerDao extends BaseDao { * @return */ List pageList(@Param("customerId") String customerId, @Param("tagName")String tagName); + } diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagScopeDao.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagScopeDao.java index 3aecba1d55..411801f4b5 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagScopeDao.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/dao/TagScopeDao.java @@ -1,10 +1,13 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.TagScopeDTO; import com.epmet.entity.TagScopeEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 标签应用范围表 * @@ -15,4 +18,6 @@ import org.apache.ibatis.annotations.Param; public interface TagScopeDao extends BaseDao { int deleteByTagId(@Param("tagId") String tagId, @Param("customerId") String customerId); + + List selectScope(String tagId); } \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java index 099df16cab..eccf691c7f 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/TagCustomerService.java @@ -25,9 +25,6 @@ import com.epmet.dto.form.TagCustomerPageFormDTO; import com.epmet.dto.result.UpdateTagUseCountsResultDTO; import com.epmet.entity.TagCustomerEntity; -import java.util.List; -import java.util.Map; - /** * 客户标签表 * @@ -46,16 +43,6 @@ public interface TagCustomerService extends BaseService { */ PageData page(TagCustomerPageFormDTO formDTO); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-06-02 - */ - List list(Map params); - /** * 单条查询 * diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java index 219cc7616c..7c1befb4f2 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/TagCustomerServiceImpl.java @@ -18,10 +18,8 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -43,7 +41,6 @@ import com.epmet.utils.TagColorUtils; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.collections4.CollectionUtils; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,7 +48,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.Date; import java.util.List; -import java.util.Map; /** * 客户标签表 @@ -78,22 +74,6 @@ public class TagCustomerServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, TagCustomerDTO.class); - } - - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - - return wrapper; - } - @Override public TagCustomerDTO get(String id) { TagCustomerEntity entity = baseDao.selectById(id); @@ -119,8 +99,8 @@ public class TagCustomerServiceImpl extends BaseServiceImpl{ + if(CollectionUtils.isNotEmpty(dto.getAgencyList())){ + dto.getAgencyList().forEach(tagScopeDTO->{ TagScopeEntity tagScopeEntity=new TagScopeEntity(); tagScopeEntity.setCustomerId(entity.getCustomerId()); tagScopeEntity.setTagId(entity.getId()); @@ -151,8 +131,8 @@ public class TagCustomerServiceImpl extends BaseServiceImpl{ + if(CollectionUtils.isNotEmpty(dto.getAgencyList())){ + dto.getAgencyList().forEach(tagScopeDTO->{ TagScopeEntity tagScopeEntity=new TagScopeEntity(); tagScopeEntity.setCustomerId(entity.getCustomerId()); tagScopeEntity.setTagId(entity.getId()); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml index a73ca7d5b8..2900561bd4 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagCustomerDao.xml @@ -56,8 +56,17 @@ ORDER BY CUSTOMER_ID + + + + + + + + + - select tc.* from tag_customer tc where tc.del_flag='0' diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagScopeDao.xml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagScopeDao.xml index ed8f0b052a..1da2fc6eca 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagScopeDao.xml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/mapper/TagScopeDao.xml @@ -8,6 +8,8 @@ + + @@ -21,4 +23,14 @@ where TAG_ID=#{tagId} and CUSTOMER_ID=#{customerId} + + \ No newline at end of file