Commit 4b15772b by QianQiXiang

Merge remote-tracking branch 'origin/developer' into developer

parents 8d0c3890 5a41193d
......@@ -140,4 +140,13 @@ public interface QywxTagApiService {
*/
public QywxTagRelationDTO getQywxTagRelationByRelationId(String relationId);
/**
* 根据会员标签关联id 查询关联信息
*
* @param qywxTagId
* @return
*/
public QywxTagInfoDTO getQywxTagByQywxTagId(String qywxTagId);
}
......@@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.ToolUtil;
import com.gic.haoban.app.customer.dto.SearchComputeDTO;
import com.gic.haoban.app.customer.dto.SearchDataDTO;
import com.gic.haoban.app.customer.enums.QywxTaskStatusEnum;
import com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.dto.*;
......@@ -81,6 +83,9 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
@Autowired
private MemberTagService memberTagService;
@Autowired
private QywxTagSyncApiService qywxTagSyncApiService;
@Override
public void pullQywxTag(String wxEnterpriseId) {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
......@@ -108,7 +113,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
//调用企业微信接口保存
QywxGetCorpTagListDTO resp = this.saveQywxTag(wxEnterpriseDTO, infoDTO, items);
if (resp.getErrcode() != 0) {
if (resp.getErrcode() != 0 && CollectionUtils.isEmpty(resp.getTagGroup())) {
logger.info("同步失败:{}", JSONObject.toJSONString(resp));
ret.setCode(resp.getErrcode());
ret.setMessage(resp.getErrmsg());
......@@ -336,7 +341,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
//删除同步 关闭同步
qywxTagService.closeSync(wxEnterpriseDto.getWxEnterpriseId(), relation.getMemberTagId());
qywxTagService.delQywxTag(callbackDTO.getTagId(), wxEnterpriseDto.getWxEnterpriseId());
saveCloseTask(qywxGroupKey.getQywxGroupName().substring(3), "-1", relation.getWxEnterpriseId(), relation.getEnterpriseId());
//标签项
} else if (relationTypeEnum.getTagType() == QywxTagRelationTypeEnum.TAG_ITEM.getTagType()) {
TabQywxTagRelation qywxTagRelation = qywxTagService.getQywxTagRelationByQywxKey(wxEnterpriseDto.getWxEnterpriseId(), callbackDTO.getTagId(), QywxTagRelationTypeEnum.TAG_ITEM.getType());
......@@ -348,12 +353,20 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
logger.info("删除标签 关闭同步:{}", qywxTagRelation.getMemberTagId());
//删除同步 关闭同步
this.closeSync(wxEnterpriseDto.getWxEnterpriseId(), qywxTagRelation.getMemberTagId());
TabQywxTag tabQywxTag = qywxTagService.getQywxTagByQywxTagId(qywxTagRelation.getWxEnterpriseId(), qywxTagRelation.getQywxTagId());
saveCloseTask(tabQywxTag.getQywxGroupName(), "-1", qywxTagRelation.getWxEnterpriseId(), qywxTagRelation.getEnterpriseId());
// qywxTagService.closeSync(wxEnterpriseDto.getWxEnterpriseId(), qywxTagRelation.getMemberTagId());
// qywxTagService.delQywxTagItemById(wxEnterpriseDto.getWxEnterpriseId(), qywxTagRelation.getQywxTagItemId());
}
}
private void saveCloseTask(String tagName, String staffId, String wxEnterpriseId, String enterpriseId) {
String content = tagName + "-关闭标签同步成功";
qywxTagSyncApiService.saveCloseTask(staffId, wxEnterpriseId, enterpriseId, content, QywxTaskStatusEnum.ALL_SUCCESS.getType());
}
/**
* 重新同步
*
......@@ -863,4 +876,10 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
TabQywxTagRelation tagRelation = qywxTagService.getQywxTagRelationById(relationId);
return EntityUtil.changeEntityByJSON(QywxTagRelationDTO.class, tagRelation);
}
@Override
public QywxTagInfoDTO getQywxTagByQywxTagId(String qywxTagId) {
TabQywxTag tabQywxTag = qywxTagService.getQywxTagByQywxTagId(null, qywxTagId);
return EntityUtil.changeEntityByJSON(QywxTagInfoDTO.class, tabQywxTag);
}
}
......@@ -80,6 +80,10 @@
<dubbo:reference id="customerApiService"
interface="com.gic.haoban.app.customer.service.api.service.CustomerApiService" timeout="10000"
retries="0" check="false"/>
<dubbo:reference id="qywxTagSyncApiService"
interface="com.gic.haoban.app.customer.service.api.service.QywxTagSyncApiService" timeout="10000"
retries="0" check="false"/>
<dubbo:reference id="enterpriseService" interface="com.gic.enterprise.api.service.EnterpriseService" timeout="10000" retries="0" check="false" />
<dubbo:reference interface="com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi" id="syncHaobanToGicServiceApi"/>
......
......@@ -250,7 +250,7 @@
<include refid="Base_Column_List"/>
from tab_haoban_qywx_tag_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and qywx_tag_item_id = #{qywxTagId,jdbcType=VARCHAR}
and qywx_tag_item_id = #{qywxTagItemId,jdbcType=VARCHAR}
and relation_type=1
and status_flag=1
</select>
......
......@@ -434,16 +434,14 @@
</select>
<select id="listAll" resultType="com.gic.haoban.manage.api.dto.StaffClerkRelationDTO">
SELECT a.store_id,
a.wx_enterprise_id,
a.wx_user_id,
a.staff_id,
a.clerk_id,
b.staff_name,
c.store_name
SELECT a.store_id storeId,
a.wx_enterprise_id wxEnterpriseId,
a.wx_user_id wxUserId,
a.staff_id staffId,
a.clerk_id clerkId,
b.staff_name staffName
FROM tab_haoban_staff_clerk_relation a
LEFT JOIN tab_haoban_staff b ON b.staff_id = a.staff_id
LEFT JOIN tab_gic_clerk c ON c.clerk_id = a.clerk_id
WHERE a.status_flag = 1
GROUP BY a.staff_id
</select>
......
......@@ -139,35 +139,19 @@ public class InfoController extends WebBaseController{
staffDTOS.addAll(userDtos);
}
if (CollectionUtils.isNotEmpty(staffDTOS)) {
loginStaff = staffDTOS.get(0);
if (staffDTOS.size() > 1) {
String dictName = loginUserId.getDictName();
String[] split = dictName.split("-");
if (split.length > 1) {
for (int i=0;i<split.length;i++) {
// String weiCorpId = split[1];
String weiCorpId = split[i];
if (enterprise.getWxEnterpriseId().equals(wxEnterpriseApiService.getEnterpriseBycorpId(weiCorpId))) {
WxEnterpriseDTO weiWxEnterpriseDTO = wxEnterpriseApiService.getEnterpriseBycorpId(weiCorpId);
System.out.println("执行"+i);
if (null != weiWxEnterpriseDTO) {
loginStaff = staffDTOS.stream().filter(staffDTO -> {
if (weiWxEnterpriseDTO.getWxEnterpriseId().equals(staffDTO.getWxEnterpriseId())) {
return true;
} else {
return false;
}
}).findFirst().orElse(staffDTOS.get(0));
}
}
loginStaff = staffDTOS.stream().filter(staffDTO -> {
if (dictName.indexOf(staffDTO.getWxEnterpriseId()) > 0) {
return true;
} else {
return false;
}
}
}).findFirst().orElse(loginStaff);
} else {
loginStaff = staffDTOS.get(0);
}
}
// StaffDTO staffDTO = staffApiService.selectByNationcodeAndPhoneNumber(enterprise.getWxEnterpriseId(), "86", midPhone);
// if (null !=staffDTO) {
// loginStaff=staffDTO;
// }
}
}
......
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