Commit fc47d5d4 by 徐高华

Merge branch 'feature/xgh/202504会员分组'

# Conflicts:
#	haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxStaffController.java
parents 2593d7bd 06407165
......@@ -54,5 +54,7 @@ public interface TabHaobanQywxFeeOrderAccountMapper {
List<TabHaobanQywxFeeOrderAccount> selectByWxEnterpriseId( @Param("wxEnterpriseId")String wxEnterpriseId);
void updateByActiveCode(@Param("wxEnterpriseId")String wxEnterpriseId , @Param("activeCode")String activeCode);
void refund(@Param("wxEnterpriseId") String wxEnterpriseId , @Param("orderId") String orderId);
}
......@@ -43,5 +43,8 @@ public interface TabHaobanQywxFeeOrderMapper {
List<TabHaobanQywxFeeOrder> listOrder(@Param("wxEnterpriseId") String wxEnterpriseId);
void refund(@Param("feeOrderId") Long feeOrderId);
}
......@@ -44,4 +44,7 @@ public interface HaobanQywxFeeOrderService {
TabHaobanQywxFeeOrder selectByOrderId(String wxEnterpriseId,String orderId);
void refund(Long feeOrderId ,String wxEnterpriseId , String orderId) ;
}
......@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.fee.impl;
import java.util.List;
import com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeOrderAccountMapper;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -26,6 +27,8 @@ public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService
@Autowired
private TabHaobanQywxFeeOrderMapper tabHaobanQywxFeeOrderMapper;
@Autowired
private TabHaobanQywxFeeOrderAccountMapper tabHaobanQywxFeeOrderAccountMapper ;
/**
* 新增数据
......@@ -60,4 +63,10 @@ public class HaobanQywxFeeOrderServiceImpl implements HaobanQywxFeeOrderService
public TabHaobanQywxFeeOrder selectByOrderId(String wxEnterpriseId, String orderId) {
return this.tabHaobanQywxFeeOrderMapper.selectByOrderId(wxEnterpriseId, orderId);
}
@Override
public void refund(Long feeOrderId , String wxEnterpriseId , String orderId) {
this.tabHaobanQywxFeeOrderMapper.refund(feeOrderId);
this.tabHaobanQywxFeeOrderAccountMapper.refund(wxEnterpriseId,orderId);
}
}
......@@ -607,6 +607,9 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
@Override
public void getQwPublishData(Long planId, String cursor) {
if(null == cursor) {
logger.info("获取企微朋友执行情况={}", planId);
}
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(planId) ;
String momentId = plan.getMomentId() ;
if(StringUtils.isBlank(momentId)) {
......@@ -658,10 +661,16 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
// 是否完成
if(params.equals("1")) {
List<Long> planIdList = this.qwMomentPlanMapper.listForData(1) ;
logger.info("朋友圈-定时1-{}",planIdList);
if(CollectionUtils.isNotEmpty(planIdList)) {
for(Long planId : planIdList) {
try{
this.getQwPublishData(planId,null) ;
CommonMQDTO mq = new CommonMQDTO() ;
mq.setType(9) ;
Map<String,String> map = new HashMap<>() ;
map.put("planId",planId+"") ;
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 10);
}catch (Exception e) {
logger.info("异常",e);
}
......@@ -672,10 +681,20 @@ public class QwMomentPlanServiceImpl implements QwMomentPlanService {
// 评论数据
if(params.equals("2")) {
List<Long> planIdList = this.qwMomentPlanMapper.listForData(2) ;
logger.info("朋友圈-定时2-{}",planIdList);
if(CollectionUtils.isNotEmpty(planIdList)) {
for(Long planId : planIdList) {
try {
this.getQwData(planId);
try{
CommonMQDTO mq = new CommonMQDTO() ;
mq.setType(10) ;
Map<String,String> map = new HashMap<>() ;
map.put("planId",planId+"") ;
mq.setParams(map);
this.haobanCommonMQApiService.putCommonDelayMessage(mq, 10);
}catch (Exception e) {
logger.info("异常",e);
}
}catch (Exception e) {
logger.info("异常",e);
}
......
......@@ -170,6 +170,14 @@ public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
Long qwPlanId = Long.valueOf(map.get("planId")) ;
this.qwMomentPlanService.sendRetry(qwPlanId);
break;
case 9 :
Long planId9 = Long.valueOf(map.get("planId")) ;
this.qwMomentPlanService.getQwPublishData(planId9,null);
break;
case 10 :
Long planId10 = Long.valueOf(map.get("planId")) ;
this.qwMomentPlanService.getQwData(planId10);
break;
default:
break;
}
......
......@@ -354,7 +354,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
StaffClerkRelationDTO staffClerkRelationDTO = staffClerkRelationService.getByClerkId(clerkId, wxEnterpriseId);
if (staffClerkRelationDTO != null) {
return ServiceResponse.failure("3", "该导购已经被绑定,不允许绑定");
// return ServiceResponse.failure("3", "该导购已经被绑定,不允许绑定");
this.unbindByStaffAndClerkId("-1", clerkId, ChannelCodeEnum.AUDIT_UNBIND.getCode(),staffClerkRelationDTO.getWxEnterpriseId());
}
return ServiceResponse.success();
}
......
......@@ -224,6 +224,11 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
}
// 查询订单下的激活码code列表,记录到activeCodeList
for (TabHaobanQywxFeeOrder order : orderList) {
FeeOrderDeatilResponseDTO wxOrder = qywxUserApiService.getOrder(corpid, serviceCorpid, order.getOrderId());
if (null != wxOrder && wxOrder.getOrder().getOrderStatus()!=1) {
this.haobanQywxFeeOrderService.refund(order.getFeeOrderId(), wxEnterpriseId, order.getOrderId());
continue;
}
List<Map<String, String>> activeCodeList = new ArrayList<>();
// 查询订单下的激活码code列表
this.getOrderAccount(order.getOrderId(), corpid, null, activeCodeList);
......
......@@ -101,5 +101,11 @@
where wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode}
</update>
<update id="refund">
update tab_haoban_qywx_fee_order_account
set status = 0, update_time = NOW()
where wx_enterprise_id = #{wxEnterpriseId} and order_id = #{orderId}
</update>
</mapper>
......@@ -53,5 +53,12 @@
from tab_haoban_qywx_fee_order
where wx_enterprise_id = #{wxEnterpriseId}
</select>
<update id="refund">
update tab_haoban_qywx_fee_order
set wx_enterprise_id = corp_id
where fee_order_id = #{feeOrderId}
</update>
</mapper>
......@@ -22,8 +22,11 @@ import com.gic.haoban.manage.service.service.content.impl.GroupMessageServiceImp
import com.gic.haoban.manage.service.service.moment.QwMomentPlanService;
import com.gic.wechat.api.dto.qdto.group.QywxMomentInfoQDTO;
import com.gic.wechat.api.dto.qywx.group.QywxMomentRespDTO;
import com.gic.wechat.api.dto.qywx.moment.MomentResultDTO;
import com.gic.wechat.api.dto.qywx.response.QywxTransferCustomerDTO;
import com.gic.wechat.api.service.qywx.QywxExternalUserService;
import com.gic.wechat.api.service.qywx.QywxSuiteApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
......@@ -53,14 +56,38 @@ public class MomentTest {
private QwMomentPlanMapper qwMomentPlanMapper ;
@Autowired
private QwMomentPlanAttendMapper qwMomentPlanAttendMapper ;
@Autowired
private QywxUserApiService qywxUserApiService ;
@Test
public void jc() {
String wxEnterpriseId = "d0a9e3cd351e4c26a526082a8c210f03";
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId) ;
String wxUserId = "JF10105";
String takeoverUserId = "JF10884";
List<String> list = new ArrayList<>();
list.add("wmEalNBwAANkqRWoKYqbMhlIxwpvTV0g");
QywxTransferCustomerDTO transferCustomerResp = qywxUserApiService.transferCustomer(qwDTO.getThirdCorpid(), qwDTO.getSelf3thSecret(), wxUserId, takeoverUserId, list,qwDTO.isSelf(),qwDTO.getUrlHost());
System.out.println(JSONObject.toJSONString(transferCustomerResp));
}
@Test
public void ok() {
SendResultQDTO plan = new SendResultQDTO() ;
plan.setWxEnterpriseId("6d52f722471343eeb7fbed87994cbdf8");
plan.setClerkId("1664331543ab49769ad5ccfb6dc7986c");
plan.setSendTime(DateUtil.strToDate("2025-05-13 18:31:00","yyyy-MM-dd HH:mm:ss"));
plan.setStaffId("e35fe570efe44201beb3381f1e50f07e");
plan.setPlanId(795415784309457024L);
this.qwMomentApiService.finishTask(plan) ;
}
@Test
public void sendToQw() {
Long id = 792759787778540646L ;
TabQwMomentPlan plan = this.qwMomentPlanMapper.getById(id) ;
this.qwMomentPlanService.sendToQiwei(plan);
// this.qwMomentPlanService.sendToQiwei(plan);
}
......@@ -108,8 +135,8 @@ public class MomentTest {
@Test
public void getmomentid() {
String wxEnterpriseId = "ca66a01b79474c40b3e7c7f93daf1a3b";
String jobId = "kyy1q5PYkElEGL6BISXVKkKZPD-Lpq76iGKEn8Z1nU4OBh9487Ni70dA638plHpD";
String wxEnterpriseId = "d4210ec4393d4be9b75b79f7e4db4287";
String jobId = "PpJSQQbEj2idWBfdPk0s8qL4RZiXOcFryhsozrorxtf_S0iGF2a2bCN0LzSBj8er";
WxEnterpriseQwDTO qwDTO = this.wxEnterpriseService.getQwInfo(wxEnterpriseId);
ServiceResponse<Object> resp2 = this.qywxExternalUserService.getMomentTaskResult(qwDTO.getThirdCorpid(),
qwDTO.getSelf3thSecret(), jobId, qwDTO.isSelf(),qwDTO.getUrlHost()) ;
......@@ -119,10 +146,9 @@ public class MomentTest {
@Test
public void data() {
Long planId = 773211358316478465L ;
// this.qwMomentPlanService.getQwData(planId);
this.qwMomentPlanService.getQwPublishData(planId,null);
Long planId = 801500314782997092L ;
//this.qwMomentPlanService.getQwPublishData(planId,null);
this.qwMomentPlanService.getQwData(planId) ;
}
......
......@@ -1559,11 +1559,8 @@ public class WxStaffController extends WebBaseController {
*/
@RequestMapping(value = "/queryMenuCodesByClerkType", method = RequestMethod.GET)
public RestResponse<HaobanRoleVO> queryMenuByClerkType(Integer clerkType, String staffId, String wxEnterpriseId , String enterpriseId) {
if(StringUtils.isBlank(wxEnterpriseId) || wxEnterpriseId.equals("-1")) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_2.getCode()), HaoBanErrCode.ERR_2.getMsg());
}
if (clerkType == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_2.getCode()), HaoBanErrCode.ERR_2.getMsg());
clerkType = -1 ;
}
if (clerkType == -1) {
logger.info("导购类型为-1,游客获取系统级别的导购权限");
......
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