src/main/java/com/mzl/flower/dto/request/configParam/ConfigCustomerServiceDTO.java
@@ -23,4 +23,10 @@ @ApiModelProperty("微信号") private String weixin; @ApiModelProperty("类型") private String type; @ApiModelProperty("联系方式") private String contact; } src/main/java/com/mzl/flower/dto/request/configParam/ConfigCustomerServiceQueryDTO.java
@@ -6,6 +6,9 @@ @Data public class ConfigCustomerServiceQueryDTO { @ApiModelProperty(value = "会员等级名称") @ApiModelProperty("类型") private String type; @ApiModelProperty("名称") private String name; } src/main/java/com/mzl/flower/dto/response/configParam/ConfigCustomerServiceVO.java
@@ -1,6 +1,7 @@ package com.mzl.flower.dto.response.configParam; import com.mzl.flower.base.AbstractTransDTO; import com.mzl.flower.base.annotation.DictTrans; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -22,4 +23,13 @@ @ApiModelProperty("微信号") private String weixin; @ApiModelProperty("类型") @DictTrans(target = "typeStr", codeType = "CONFIG_CUSTOMER_CONTACT") private String type; private String typeStr; @ApiModelProperty("联系方式") private String contact; } src/main/java/com/mzl/flower/entity/configParam/ConfigCustomerService.java
@@ -32,4 +32,9 @@ @ApiModelProperty("微信号") private String weixin; @ApiModelProperty("类型") private String type; @ApiModelProperty("联系方式") private String contact; } src/main/java/com/mzl/flower/mapper/configParam/ConfigParamMapper.java
@@ -5,6 +5,8 @@ import com.mzl.flower.dto.response.configParam.ConfigParamVO; import com.mzl.flower.entity.configParam.ConfigParamDO; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.mzl.flower.entity.configParam.ConfigParamGroupDO; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; import java.util.List; @@ -24,4 +26,12 @@ String getBaseString(String paramGroup, String paramKey); List<ConfigParamVO> queryPage(QueryConfigParamDTO dto, Page page); @Select("select * from t_config_param_group where param_group = #{paramGroup} and deleted = '0' limit 1") ConfigParamGroupDO getByParamGroup(@Param("paramGroup") String paramGroup); @Select("select * from t_config_param_group where param_group_name = #{paramGroupName} and deleted = '0' limit 1") ConfigParamGroupDO getByParamGroupName(@Param("paramGroupName")String paramGroupName); } src/main/java/com/mzl/flower/service/config/impl/ConfigCustomerServiceServiceImpl.java
@@ -36,7 +36,6 @@ BeanUtils.copyProperties(configCustomerServiceDTO, configCustomerService); configCustomerService.create(SecurityUtils.getUserId()); configCustomerServiceMapper.insert(configCustomerService); } @Override @@ -45,7 +44,6 @@ BeanUtils.copyProperties(configCustomerServiceDTO, configCustomerServiceInfo); configCustomerServiceInfo.update(SecurityUtils.getUserId()); configCustomerServiceMapper.updateById(configCustomerServiceInfo); } @Override src/main/java/com/mzl/flower/service/impl/ConfigParamGroupServiceImpl.java
@@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.mzl.flower.config.exception.ValidationException; import com.mzl.flower.config.security.SecurityUtils; import com.mzl.flower.dto.request.configParam.ParamGroupDTO; import com.mzl.flower.dto.request.configParam.QueryConfigParamDTO; @@ -12,11 +13,13 @@ import com.mzl.flower.entity.configParam.ConfigParamGroupDO; import com.mzl.flower.mapper.configParam.ConfigParamGroupMapper; import com.mzl.flower.mapper.configParam.ConfigParamGroupMapperCustom; import com.mzl.flower.mapper.configParam.ConfigParamMapper; import com.mzl.flower.service.ConfigParamGroupService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.ObjectUtils; import java.util.List; @@ -37,6 +40,9 @@ @Autowired private ConfigParamGroupMapper configParamGroupMapper; @Autowired ConfigParamMapper configParamMapper; @Override public List<ConfigParamGroupDO> getList(QueryConfigParamDTO dto) { QueryWrapper<ConfigParamGroupDO> wrapper = new QueryWrapper<>(); @@ -47,6 +53,14 @@ @Override public void saveConfigParamGroup(ParamGroupDTO dto) { ConfigParamGroupDO c1 = configParamMapper.getByParamGroup(dto.getParamGroup()); if (!ObjectUtils.isEmpty(c1)) { throw new ValidationException("变量分组重复"); } ConfigParamGroupDO c2 = configParamMapper.getByParamGroupName(dto.getParamGroupName()); if (!ObjectUtils.isEmpty(c2)) { throw new ValidationException("变量分组名重复"); } ConfigParamGroupDO configParamGroupDO = new ConfigParamGroupDO(); BeanUtils.copyProperties(dto, configParamGroupDO); configParamGroupDO.create(SecurityUtils.getUserId()); @@ -55,6 +69,19 @@ @Override public void updateConfigParamGroup(ParamGroupDTO dto) { ConfigParamGroupDO c1 = configParamMapper.getByParamGroup(dto.getParamGroup()); if (!ObjectUtils.isEmpty(c1)) { if (c1.getId() != dto.getId()) { throw new ValidationException("已存在变量分组,无法修改"); } } ConfigParamGroupDO c2 = configParamMapper.getByParamGroupName(dto.getParamGroupName()); if (!ObjectUtils.isEmpty(c2)) { if (c2.getId() != dto.getId()) { throw new ValidationException("已存在变量分组名,无法修改"); } } ConfigParamGroupDO configParamGroupDO = configParamGroupMapper.selectById(dto.getId()); BeanUtils.copyProperties(dto, configParamGroupDO); configParamGroupDO.update(SecurityUtils.getUserId()); src/main/java/com/mzl/flower/service/impl/ConfigParamServiceImpl.java
@@ -10,6 +10,7 @@ import com.mzl.flower.dto.response.configParam.ConfigCustomerServiceVO; import com.mzl.flower.dto.response.configParam.ConfigParamVO; import com.mzl.flower.entity.configParam.ConfigParamDO; import com.mzl.flower.entity.menber.Member; import com.mzl.flower.enums.ConfigParamEnum; import com.mzl.flower.mapper.configParam.ConfigParamMapper; import com.mzl.flower.mapper.configParam.ConfigParamMapperCustom; @@ -23,6 +24,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.ObjectUtils; import java.util.*; import java.util.stream.Collectors; src/main/resources/mapper/configParam/ConfigCustomerServiceMapper.xml
@@ -7,8 +7,11 @@ select t.*, u.nick_name createName from t_config_customer_service t left join t_user u on t.create_by = u.id where t.deleted= 0 <if test="dto.type != null and dto.type != ''"> and t.type= #{dto.type} </if> <if test="dto.name != null and dto.name != ''"> and t.name like concat('%', #{dto.name}, '%') and t.name= #{dto.name} </if> </select>