|
|
@@ -5,10 +5,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import io.seata.common.util.CollectionUtils;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.client.entity.CorpsAttn;
|
|
|
+import org.springblade.client.entity.CorpsDesc;
|
|
|
import org.springblade.client.feign.ICorpsAttnClient;
|
|
|
import org.springblade.client.feign.ICorpsDescClient;
|
|
|
+import org.springblade.client.feign.IWechatClient;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
+import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
import org.springblade.core.tool.utils.StringUtil;
|
|
|
import org.springblade.purchase.sales.entity.Biding;
|
|
|
@@ -18,6 +21,8 @@ import org.springblade.purchase.sales.mapper.BidingAgentMapper;
|
|
|
import org.springblade.purchase.sales.mapper.BidingItemsMapper;
|
|
|
import org.springblade.purchase.sales.mapper.BidingMapper;
|
|
|
import org.springblade.purchase.sales.service.IBidingItemsService;
|
|
|
+import org.springblade.system.user.entity.User;
|
|
|
+import org.springblade.system.user.feign.IUserClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Date;
|
|
|
@@ -36,7 +41,10 @@ public class BidingItemsServiceImpl extends ServiceImpl<BidingItemsMapper, Bidin
|
|
|
|
|
|
private final BidingMapper bidingMapper;
|
|
|
private final BidingAgentMapper bidingAgentMapper;
|
|
|
- private final ICorpsAttnClient corpsAttnClient;
|
|
|
+ private final ICorpsAttnClient corpsAttnClient;//客户联系人
|
|
|
+ private final ICorpsDescClient corpsDescClient;//获取客户信息
|
|
|
+ private final IUserClient userClient;//获得用户信息
|
|
|
+ private final IWechatClient wechatClient;//微信
|
|
|
|
|
|
/**
|
|
|
* 保存订单明细信息
|
|
|
@@ -120,6 +128,20 @@ public class BidingItemsServiceImpl extends ServiceImpl<BidingItemsMapper, Bidin
|
|
|
.eq(BidingItems::getDistinguish, distinguish)
|
|
|
.eq(BidingItems::getIsDeleted, 0)
|
|
|
.eq(BidingItems::getTenantId, AuthUtil.getTenantId()));
|
|
|
+
|
|
|
+ if (distinguish.equals(1)){
|
|
|
+ if (ObjectUtil.isNotEmpty(list)){
|
|
|
+ list.forEach(e -> {
|
|
|
+ if (ObjectUtil.isNotEmpty(e.getCorpsAttnId())){
|
|
|
+ R<CorpsDesc> corpMessage = corpsDescClient.getCorpMessage(e.getCorpsAttnId());
|
|
|
+ if (corpMessage.isSuccess() && corpMessage.getData() != null){
|
|
|
+ e.setContrastName(corpMessage.getData().getCname());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
@@ -190,6 +212,23 @@ public class BidingItemsServiceImpl extends ServiceImpl<BidingItemsMapper, Bidin
|
|
|
BidingAgent bidingAgent = bidingAgentMapper.selectOne(lambdaQueryWrapper);
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(bidingAgent)){
|
|
|
+ //根据代理客户的客户联系人进行消息推送
|
|
|
+ //获得所有代理客户
|
|
|
+
|
|
|
+ /*CorpsDesc corpsDesc = corpsDescClient.getCorpId(bidingAgent.getAgentId());
|
|
|
+ //获得客户的所有客户联系人
|
|
|
+ List<CorpsAttn> attnList = corpsAttnClient.getAttn(corpsDesc.getId());
|
|
|
+ attnList.forEach(corpsAttn -> {
|
|
|
+ //获得用户信息
|
|
|
+ R<User> user = userClient.userInfoById(corpsAttn.getUserId());
|
|
|
+ if (ObjectUtil.isNotEmpty(user)){
|
|
|
+ if (ObjectUtil.isNotEmpty(user.getData().getUnionId())){
|
|
|
+ *//*String msg = wechatClient.newsPush(user.getData().getUnionId(),
|
|
|
+ salesBiding.getContractNo(), harbor, salesBiding.getCargoInformation(),loadingTime);*//*
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });*/
|
|
|
+
|
|
|
//更新代理明细信息
|
|
|
bidingAgent.setStatus(6);
|
|
|
bidingAgentMapper.updateById(bidingAgent);
|