|
@@ -3,9 +3,11 @@ package com.management.platform.service.impl;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
import com.management.platform.entity.*;
|
|
import com.management.platform.entity.*;
|
|
import com.management.platform.mapper.*;
|
|
import com.management.platform.mapper.*;
|
|
import com.management.platform.service.BusinessOpportunityService;
|
|
import com.management.platform.service.BusinessOpportunityService;
|
|
@@ -77,7 +79,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
|
|
businessOpportunity.setUploadFilePList(uploadFileMapper.selectByInfoList("business",bo.getId()));
|
|
businessOpportunity.setUploadFilePList(uploadFileMapper.selectByInfoList("business",bo.getId()));
|
|
businessOpportunity.setTaskList(taskMapper.selectList(new QueryWrapper<Task>().eq("business_opportunity_id",bo.getId())));
|
|
businessOpportunity.setTaskList(taskMapper.selectList(new QueryWrapper<Task>().eq("business_opportunity_id",bo.getId())));
|
|
List<BusinessItemProduct> businessItemProducts = biMapper.selectListToBoId(bo.getId());
|
|
List<BusinessItemProduct> businessItemProducts = biMapper.selectListToBoId(bo.getId());
|
|
- businessOpportunity.setBusinessItemProductList(businessItemProducts);
|
|
|
|
|
|
+ businessOpportunity.setBusinessItemProducts(businessItemProducts);
|
|
if (businessItemProducts.size() > 0){
|
|
if (businessItemProducts.size() > 0){
|
|
BigDecimal finalPrice = new BigDecimal(0);
|
|
BigDecimal finalPrice = new BigDecimal(0);
|
|
BigDecimal discountedPrice = new BigDecimal(0);
|
|
BigDecimal discountedPrice = new BigDecimal(0);
|
|
@@ -123,11 +125,13 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
|
|
setNull(bo);
|
|
setNull(bo);
|
|
bo.setCreateTime(new Date());
|
|
bo.setCreateTime(new Date());
|
|
bOMapper.insert(bo);
|
|
bOMapper.insert(bo);
|
|
|
|
+ List<BusinessItemProduct> businessItemProducts = JSONArray.parseArray(bo.getBusinessItemProductList(), BusinessItemProduct.class);
|
|
|
|
+ System.out.println(businessItemProducts);
|
|
ActionLog actionLog = new ActionLog();
|
|
ActionLog actionLog = new ActionLog();
|
|
actionLog.setUserId(bo.getUserId());
|
|
actionLog.setUserId(bo.getUserId());
|
|
actionLog.setItemId(bo.getId());
|
|
actionLog.setItemId(bo.getId());
|
|
actionLog.setCode("business");
|
|
actionLog.setCode("business");
|
|
- actionLog.setName("创建了线索");
|
|
|
|
|
|
+ actionLog.setName("创建了商机");
|
|
actionLogMapper.insert(actionLog);
|
|
actionLogMapper.insert(actionLog);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -168,13 +172,13 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
|
|
for (BusinessOpportunity clue1 : clues) {
|
|
for (BusinessOpportunity clue1 : clues) {
|
|
if (clue1.getInchargerId() == null) {
|
|
if (clue1.getInchargerId() == null) {
|
|
//认领
|
|
//认领
|
|
- clueLog.setName("认领了线索");
|
|
|
|
|
|
+ clueLog.setName("认领了商机");
|
|
clueLog.setUserId(user.getId());
|
|
clueLog.setUserId(user.getId());
|
|
bo.setInchargerId(user.getId());
|
|
bo.setInchargerId(user.getId());
|
|
actionLogMapper.insert(clueLog);
|
|
actionLogMapper.insert(clueLog);
|
|
} else {
|
|
} else {
|
|
//转移
|
|
//转移
|
|
- clueLog.setName("转移了线索");
|
|
|
|
|
|
+ clueLog.setName("转移了商机");
|
|
bo.setInchargerId(bo.getInchargerId());
|
|
bo.setInchargerId(bo.getInchargerId());
|
|
actionLogMapper.insert(clueLog);
|
|
actionLogMapper.insert(clueLog);
|
|
}
|
|
}
|
|
@@ -216,9 +220,9 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
msg.setMsg("操作成功");
|
|
msg.setMsg("操作成功");
|
|
biMapper.delete(new QueryWrapper<BusinessItemProduct>().eq("business_id",bo.getId()));
|
|
biMapper.delete(new QueryWrapper<BusinessItemProduct>().eq("business_id",bo.getId()));
|
|
- List<BusinessItemProduct> businessItemProductList = bo.getBusinessItemProductList();
|
|
|
|
|
|
+ List<BusinessItemProduct> businessItemProducts = JSONArray.parseArray(bo.getBusinessItemProductList(), BusinessItemProduct.class);
|
|
// biMapper.saveBatch()
|
|
// biMapper.saveBatch()
|
|
- for (BusinessItemProduct businessItemProduct : businessItemProductList) {
|
|
|
|
|
|
+ for (BusinessItemProduct businessItemProduct : businessItemProducts) {
|
|
biMapper.insert(businessItemProduct);
|
|
biMapper.insert(businessItemProduct);
|
|
}
|
|
}
|
|
ActionLog al = new ActionLog();
|
|
ActionLog al = new ActionLog();
|
|
@@ -371,6 +375,11 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
|
|
return bOMapper.getDataStage(companyId,startDate,endDate,userId,targetUserIds);
|
|
return bOMapper.getDataStage(companyId,startDate,endDate,userId,targetUserIds);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void deleterDelete(List<Integer> ids) {
|
|
|
|
+ bOMapper.deleteBatchIds(ids);
|
|
|
|
+ }
|
|
|
|
+
|
|
private BusinessOpportunity setNull(BusinessOpportunity bo) {
|
|
private BusinessOpportunity setNull(BusinessOpportunity bo) {
|
|
if (bo.getPlate1() == "") {
|
|
if (bo.getPlate1() == "") {
|
|
bo.setPlate1(null);
|
|
bo.setPlate1(null);
|