Commit f44bb58e by 徐高华

Merge branch 'feature/xgh/zq12' into 'master'

Feature/xgh/zq12

See merge request !2407
parents 76f557d9 9730e3f1
package com.gic.haoban.manage.api.dto.hm;
import java.io.Serializable;
public class ClerkQrcodeDTO implements Serializable {
private String clerkId ;
private String qwQrcode ;
public String getClerkId() {
return clerkId;
}
public void setClerkId(String clerkId) {
this.clerkId = clerkId;
}
public String getQwQrcode() {
return qwQrcode;
}
public void setQwQrcode(String qwQrcode) {
this.qwQrcode = qwQrcode;
}
}
......@@ -4,10 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchCountDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchModifyResultDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.dto.hm.*;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
......@@ -197,4 +194,6 @@ public interface HmQrcodeApiService {
ServiceResponse<HmBatchCountDTO> getModifyResult(String wxEnterpriseId , String taskId) ;
List<ClerkQrcodeDTO> listClerkQrcode(String enterpriseId, List<String> clerkIdList);
}
......@@ -43,7 +43,7 @@ public interface DepartmentMapper {
// List<TabHaobanDepartment> listStoreByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
TabHaobanDepartment getRootByEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
List<TabHaobanDepartment> getRootByEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId);
Page<TabHaobanDepartment> pageFullStoreByWxEnterpriseId(@Param("wxEnterpriseId")String wxEnterpriseId,@Param("search")String search,@Param("storeIds")List<String> storeIds,@Param("minCount")int minCount);
......
package com.gic.haoban.manage.service.dao.mapper.hm;
import com.gic.haoban.manage.api.dto.hm.ClerkQrcodeDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.service.entity.hm.TabHaobanHmQrcode;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeClerkBO;
......@@ -206,6 +207,14 @@ public interface TabHaobanHmQrcodeMapper {
* 返回已有单人活码的clerkId
*/
List<String> listHasQrcodeClerk(@Param("enterpriseId") String enterpriseId, @Param("clerkIdList") List<String> clerkIdList);
/**
* 导购活码
* @param enterpriseId
* @param clerkIdList
* @return
*/
List<ClerkQrcodeDTO> listClerkQrcode(@Param("enterpriseId") String enterpriseId, @Param("clerkIdList") List<String> clerkIdList) ;
/**
* 获取导购单人活码
......
package com.gic.haoban.manage.service.service.hm;
import com.gic.haoban.manage.api.dto.hm.ClerkQrcodeDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeQDTO;
import com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeBO;
......@@ -173,6 +174,8 @@ public interface HmQrcodeService {
List<String> listHasQrcodeClerk(String enterpriseId, List<String> clerkIdList);
List<ClerkQrcodeDTO> listClerkQrcode(String enterpriseId, List<String> clerkIdList);
/**
* 更新导购名称
*
......
......@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.hm.impl;
import java.util.Date;
import java.util.List;
import com.gic.haoban.manage.api.dto.hm.ClerkQrcodeDTO;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
......@@ -191,6 +192,11 @@ public class HmQrcodeServiceImpl implements HmQrcodeService {
}
@Override
public List<ClerkQrcodeDTO> listClerkQrcode(String enterpriseId, List<String> clerkIdList) {
return this.tabHaobanHmQrcodeMapper.listClerkQrcode(enterpriseId,clerkIdList);
}
@Override
public void updateClerkNameByClerkId(String enterpriseId, String clerkId, String clerkName, String clerkCode) {
tabHaobanHmQrcodeMapper.updateClerkNameByClerkId(enterpriseId, clerkId, clerkName, clerkCode);
tabHaobanHmClerkRelationMapper.updateClerkNameByClerkId(enterpriseId, clerkId, clerkName, clerkCode);
......
......@@ -233,8 +233,11 @@ public class DepartmentServiceImpl implements DepartmentService {
@Override
public DepartmentDTO getRootByEnterpriseId(String wxEnterpriseId) {
TabHaobanDepartment tab = mapper.getRootByEnterpriseId(wxEnterpriseId);
return EntityUtil.changeEntityByJSON(DepartmentDTO.class, tab);
List<TabHaobanDepartment> tabList = mapper.getRootByEnterpriseId(wxEnterpriseId);
if(CollectionUtils.isEmpty(tabList) || tabList.size()>1) {
return null ;
}
return EntityUtil.changeEntityByJSON(DepartmentDTO.class, tabList.get(0));
}
@Override
......
......@@ -186,7 +186,7 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
}
wxUserAddLogService.save(wxUserAddLogQDTO);
//定制
addDelFriendEvent(related.getUnionid(), related.getClerkId(), wxEnterpriseId, enterpriseId, related.getMemberId(), related.getStoreId(), 0);
addDelFriendEvent(related.getUnionid(), related.getClerkId(), wxEnterpriseId, enterpriseId, related.getMemberId(), related.getStoreId(), 0,related.getExternalUserId());
}
/**
......@@ -198,7 +198,22 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
* @param memberId
* @param storeId
*/
private void addDelFriendEvent(String unionId, String clerkId, String wxEnterpriseId, String enterpriseId, String memberId, String storeId, Integer changeType) {
private void addDelFriendEvent(String unionId, String clerkId, String wxEnterpriseId, String enterpriseId, String memberId, String storeId, Integer changeType , String externalUserid) {
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
if(StringUtils.isNotBlank(memberId)) {
logger.info("加好友、删好友通知={}",memberId);
JSONObject json = new JSONObject() ;
json.put("enterpriseId",enterpriseId) ;
json.put("clerkId",clerkId) ;
json.put("memberId",memberId) ;
json.put("externalUserid",externalUserid) ;
json.put("changeType",changeType);
try {
clientInstance.sendMessage("qywxAddFriendEvent", json.toJSONString());
} catch (Exception e) {
throw new RuntimeException(e);
}
}
String addDelFriendEvent = config.getAddDelFriendEvent();
if (!addDelFriendEvent.contains(wxEnterpriseId)) {
logger.info("非定制,无需广播通知");
......@@ -218,7 +233,6 @@ public class ExternalClerkRelatedServiceImpl implements ExternalClerkRelatedServ
logger.info("会员不存在:{}", memberId);
return;
}
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
JSONObject msgBody = new JSONObject();
msgBody.put("cardNo", member.getCardNum());
......
......@@ -191,8 +191,12 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
TabHaobanClerkMainStoreRelated mainStore = this.clerkMainStoreRelatedService.getMainStoreByStaffId(staffId, wxEnterpriseId, storeIdList) ;
String newStoreId = mainStore.getStoreId() ;
StaffClerkRelationDTO mainClerk = this.getOneBindByStoreId(staffId, newStoreId) ;
newClerkId = mainClerk.getClerkId() ;
logger.info("查询到成员的主门店导购={},{}",staffId,newClerkId);
if(null != mainClerk) {
newClerkId = mainClerk.getClerkId();
logger.info("查询到成员的主门店导购={},{}", staffId, newClerkId);
}else {
logger.info("未匹配到导购={},{}",staffId,newStoreId);
}
}
}else {
if(multipleFlag) {
......
......@@ -871,16 +871,18 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
/**
* 欧泊莱定制需求
*/
// changeType 0删好友 1加好友
private void addDelFriendEvent(String unionId, String clerkId, String wxEnterpriseId, String enterpriseId, String memberId, String storeId, Integer changeType , String externalUserid , boolean isNewMember) {
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
if(changeType==1) {
log.info("加好友通知={}",memberId);
if(StringUtils.isNotBlank(memberId)) {
log.info("加好友、删好友通知={}",memberId);
JSONObject json = new JSONObject() ;
json.put("enterpriseId",enterpriseId) ;
json.put("clerkId",clerkId) ;
json.put("memberId",memberId) ;
json.put("externalUserid",externalUserid) ;
json.put("isNewMember",isNewMember) ;
json.put("changeType",changeType);
try {
clientInstance.sendMessage("qywxAddFriendEvent", json.toJSONString());
} catch (Exception e) {
......
......@@ -8,6 +8,7 @@ import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import com.gic.haoban.manage.api.dto.hm.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
......@@ -33,11 +34,6 @@ import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchCountDTO;
import com.gic.haoban.manage.api.dto.hm.HmBatchModifyResultDTO;
import com.gic.haoban.manage.api.dto.hm.HmClerkDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeDTO;
import com.gic.haoban.manage.api.dto.hm.HmQrcodeStoreDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmBatchModifyQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmClerkRelationQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmQrcodeListQDTO;
......@@ -1038,4 +1034,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
dto.setFailList(failList);
return ServiceResponse.success(dto);
}
@Override
public List<ClerkQrcodeDTO> listClerkQrcode(String enterpriseId, List<String> clerkIdList) {
return this.hmQrcodeService.listClerkQrcode(enterpriseId,clerkIdList);
}
}
......@@ -430,8 +430,18 @@
</foreach>
and hm_type = 1 and status_flag in (1,3)
</select>
<select id="getClerkQrcode" resultType="java.lang.String">
<select id="listClerkQrcode" resultType="com.gic.haoban.manage.api.dto.hm.ClerkQrcodeDTO">
select clerk_id clerkId , wx_qrcode qwQrcode from tab_haoban_hm_qrcode where enterprise_id=#{enterpriseId}
and clerk_id in
<foreach collection="clerkIdList" item="id" index="index" open="(" close=")" separator=",">
#{id}
</foreach>
and hm_type = 1 and status_flag in (1,3)
</select>
<select id="getClerkQrcode" resultType="java.lang.String">
select wx_qrcode from tab_haoban_hm_qrcode where enterprise_id=#{enterpriseId}
and clerk_id = #{clerkId}
and hm_type = 1 and status_flag = 1 limit 1
......
......@@ -92,6 +92,9 @@ public class DepartmentContoller extends WebBaseController {
page = departmentApiService.pageByParentId(parentId, keyWord, pageInfo);
} else {
DepartmentDTO dto = departmentApiService.getRootByEnterpriseId(wxEnterpriseId);
if(null == dto) {
return new HaobanResponse(-1,"根部门异常,请重新同步通讯录") ;
}
list.add(dto);
page.setTotalPage(1);
page.setTotalCount(1);
......@@ -131,6 +134,9 @@ public class DepartmentContoller extends WebBaseController {
list = departmentApiService.listByParentId(parentId);
} else {
DepartmentDTO dto = departmentApiService.getRootByEnterpriseId(wxEnterpriseId);
if(null == dto) {
return new HaobanResponse(-1,"根部门异常,请重新同步通讯录") ;
}
list.add(dto);
}
Set<String> enterpriseSet = new HashSet<>();
......
......@@ -498,6 +498,9 @@ public class StaffController extends WebBaseController {
String wxEnterpriseId = login.getWxEnterpriseId();
if(StringUtils.isBlank(departmentId)){
DepartmentDTO dto = this.departmentApiService.getRootByEnterpriseId(wxEnterpriseId) ;
if(null == dto) {
return new HaobanResponse(-1,"根部门异常,请重新同步通讯录") ;
}
departmentId = dto.getDepartmentId() ;
}
List<String> departmentIdSet = new ArrayList<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment