|
@@ -17,8 +17,13 @@
|
|
|
package com.fjhx.track.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.fjhx.common.attachment.IAttachmentApi;
|
|
|
+import com.fjhx.contract.entity.Contract;
|
|
|
+import com.fjhx.contract.service.IContractService;
|
|
|
+import com.fjhx.message.enums.MessageNoticeEnum;
|
|
|
+import com.fjhx.message.service.IMessageNoticeService;
|
|
|
import com.fjhx.purchase.entity.PurchaseContract;
|
|
|
import com.fjhx.purchase.service.IPurchaseContractService;
|
|
|
import com.fjhx.track.entity.Track;
|
|
@@ -40,6 +45,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -61,6 +67,15 @@ public class TrackServiceImpl extends ServiceImpl<TrackMapper, Track> implements
|
|
|
@Autowired
|
|
|
private IDictBizClient iDictBizClient;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IContractService contractService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ITrackService trackService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IMessageNoticeService iMessageNoticeService;
|
|
|
+
|
|
|
@Override
|
|
|
public List<Track> findTrackTypeATime(String selectTrackByProductId) {
|
|
|
List<Track> list = baseMapper.selectTrackByProductId(selectTrackByProductId);
|
|
@@ -102,7 +117,11 @@ public class TrackServiceImpl extends ServiceImpl<TrackMapper, Track> implements
|
|
|
}
|
|
|
//编辑跟单后发送消息给用户
|
|
|
PurchaseContract purchaseContract = iPurchaseContractService.getById(track.getPurchaseContractId());
|
|
|
- System.out.println(purchaseContract.getContractCode()+" 合同有新的跟进记录(节点:"+iDictBizClient.getValue("purchase_track_type",track.getTrackType())+"),请及时查看");
|
|
|
+ R<String> iDictBizClientValue =iDictBizClient.getValue("purchase_track_type",track.getTrackType());
|
|
|
+ String msg = purchaseContract.getContractCode()+" 合同有新的跟进记录(节点:"+iDictBizClientValue.getData()+"),请及时查看";
|
|
|
+ String createUser = contractService.getById(purchaseContract.getContractId()).getCreateUser();
|
|
|
+ // 发送消息通知
|
|
|
+ iMessageNoticeService.send(track.getId(), Arrays.asList(createUser), msg, MessageNoticeEnum.MESSAGE_NOTICE_TYPE_26.getKey());
|
|
|
return true;
|
|
|
}
|
|
|
|