Commit 2eac473f by 水库浪子

客户列表等BUG修复

1 parent 870a7ed0
package com.linkwechat.web.controller.wecom;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.linkwechat.common.annotation.Log;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.controller.BaseController;
......@@ -8,6 +10,7 @@ import com.linkwechat.common.core.domain.AjaxResult;
import com.linkwechat.common.core.page.TableDataInfo;
import com.linkwechat.common.enums.BusinessType;
import com.linkwechat.common.utils.Threads;
import com.linkwechat.wecom.domain.WeTag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContext;
......@@ -23,6 +26,8 @@ import org.springframework.web.bind.annotation.RestController;
import com.linkwechat.wecom.domain.WeTagGroup;
import com.linkwechat.wecom.service.IWeTagGroupService;
import java.util.List;
/**
* 标签组Controller
*
......@@ -60,6 +65,18 @@ public class WeTagGroupController extends BaseController
@PostMapping
public AjaxResult add(@RequestBody WeTagGroup weTagGroup)
{
//校验标签组名称与标签名称是否相同
if(StrUtil.isNotBlank(weTagGroup.getGourpName())){
List<WeTag> weTags = weTagGroup.getWeTags();
if(CollectionUtil.isNotEmpty(weTags)){
if(weTags.stream().filter(m -> m.getName().equals(weTagGroup.getGourpName())).findAny().isPresent()){
return AjaxResult.error("标签组名称与标签名不可重复");
}
}
}
weTagGroupService.insertWeTagGroup(weTagGroup);
return AjaxResult.success();
......
......@@ -115,6 +115,10 @@ public class WeUser
private String remark;
private String departmentStr;
/** 转化成企业微信需要的dto对象 */
public WeUserDto transformWeUserDto(){
......
......@@ -111,7 +111,6 @@ public class WeCustomerServiceImpl extends ServiceImpl<WeCustomerMapper, WeCusto
*/
@Override
public List<WeCustomer> selectWeCustomerList(WeCustomer weCustomer) {
return weCustomerMapper.selectWeCustomerList(weCustomer);
}
......
......@@ -98,8 +98,9 @@ public class WeEmpleCodeServiceImpl extends ServiceImpl<WeEmpleCodeMapper, WeEmp
*/
@Override
public List<WeEmpleCode> selectWeEmpleCodeList(WeEmpleCode weEmpleCode) {
List<WeEmpleCode> weEmpleCodeList = this.baseMapper.selectWeEmpleCodeList(weEmpleCode);
if (weEmpleCodeList != null) {
if (CollectionUtil.isNotEmpty(weEmpleCodeList)) {
weEmpleCodeList.forEach(empleCode -> {
List<WeEmpleCodeUseScop> weEmpleCodeUseScopList = empleCode.getWeEmpleCodeUseScops();
if (CollectionUtil.isNotEmpty(weEmpleCodeUseScopList)) {
......
......@@ -70,7 +70,6 @@ public class WeTagGroupServiceImpl extends ServiceImpl<WeTagGroupMapper, WeTagGr
if (CollectionUtil.isEmpty(weTags)) {
this.save(weTagGroup);
} else {
WeCropGropTagDtlDto weCropGropTagDtlDto = weCropTagClient.addCorpTag(WeCropGroupTagDto.transformAddTag(weTagGroup));
......
package com.linkwechat.wecom.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ArrayUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.linkwechat.common.constant.WeConstans;
import com.linkwechat.common.core.redis.RedisCache;
......@@ -16,6 +17,7 @@ import com.linkwechat.wecom.service.IWeCustomerService;
import com.linkwechat.wecom.service.IWeDepartmentService;
import com.linkwechat.wecom.service.IWeGroupService;
import com.linkwechat.wecom.service.IWeUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -80,6 +82,10 @@ public class WeUserServiceImpl extends ServiceImpl<WeUserMapper,WeUser> implemen
@Override
public List<WeUser> selectWeUserList(WeUser weUser)
{
String[] department = weUser.getDepartment();
if(ArrayUtil.isNotEmpty(department)){
weUser.setDepartmentStr(StringUtils.join(department, ","));
}
return weUserMapper.selectWeUserList(weUser);
}
......
......@@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.linkwechat.wecom.mapper.WeCustomerMapper">
<resultMap type="WeCustomer" id="WeCustomerResult">
<resultMap type="com.linkwechat.wecom.domain.WeCustomer" id="WeCustomerResult">
<id property="externalUserid" column="external_userid" />
<result property="name" column="name" />
<result property="avatar" column="avatar" />
......
......@@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
wm.material_url
FROM
we_msg_tlp wmt
INNER JOIN we_material wm ON wmt.media_id=wm.id
LEFT JOIN we_material wm ON wmt.media_id=wm.id
<where>
<if test="welcomeMsg != null and welcomeMsg != ''"> and wmt.welcome_msg like CONCAT('%',#{welcomeMsg,jdbcType=VARCHAR},'%') </if>
<if test="welcomeMsgTplType !=null "> and wmt.welcome_msg_tpl_type = #{welcomeMsgTplType}</if>
......
......@@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="mobile != null and mobile != ''"> and mobile = #{mobile}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="wxAccount != null and wxAccount != ''"> and wx_account = #{wxAccount}</if>
<if test="department != null and department.length > 0 "> and FIND_IN_SET(#{department},department)</if>
<if test="departmentStr != null and departmentStr != '' "> and FIND_IN_SET(#{departmentStr},department)</if>
<if test="position != null and position != ''"> and position = #{position}</if>
<if test="isLeaderInDept != null "> and is_leader_in_dept = #{isLeaderInDept}</if>
<if test="joinTime != null "> and join_time = #{joinTime}</if>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!