|
@@ -1,5 +1,6 @@
|
|
|
package com.management.platform.service.impl;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.management.platform.entity.ActionLog;
|
|
|
import com.management.platform.entity.BusinessOpportunity;
|
|
@@ -12,6 +13,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -81,8 +83,41 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void getAndTransfer(Clue clue, User user) {
|
|
|
+ public void getAndTransfer(BusinessOpportunity bo, User user) {
|
|
|
+ UpdateWrapper<BusinessOpportunity> updateWrapper = new UpdateWrapper<>();
|
|
|
+ String ids1 = bo.getIds();
|
|
|
+ List<Integer> ids = new ArrayList<>();
|
|
|
+ if (!ids1.isEmpty()) {
|
|
|
+ for (String id : ids1.split(",")) {
|
|
|
+ ids.add(Integer.parseInt(id));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ updateWrapper.in("id", ids);
|
|
|
+ String inchargerId = bo.getInchargerId();
|
|
|
+ ActionLog clueLog = new ActionLog();
|
|
|
+ clueLog.setUserId(user.getId());
|
|
|
+ clueLog.setItemId(bo.getId());
|
|
|
+ clueLog.setCreatTime(new Date());
|
|
|
+ clueLog.setCode("business");
|
|
|
+
|
|
|
+ List<BusinessOpportunity> clues = bOMapper.selectList(new QueryWrapper<BusinessOpportunity>().in("id", ids));
|
|
|
+ for (BusinessOpportunity clue1 : clues) {
|
|
|
+ if (clue1.getInchargerId() == null) {
|
|
|
+ //认领
|
|
|
+ clueLog.setName("认领了线索");
|
|
|
+ clueLog.setUserId(user.getId());
|
|
|
+ bo.setInchargerId(user.getId());
|
|
|
+ actionLogMapper.insert(clueLog);
|
|
|
+ } else {
|
|
|
+ //转移
|
|
|
+ clueLog.setName("转移了线索");
|
|
|
+ bo.setInchargerId(bo.getInchargerId());
|
|
|
+ actionLogMapper.insert(clueLog);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ updateWrapper.set("incharger_id",inchargerId);
|
|
|
+ bOMapper.update(null, updateWrapper);
|
|
|
}
|
|
|
private BusinessOpportunity setNull(BusinessOpportunity bo) {
|
|
|
if (bo.getPlate1() == "") {
|