线索批量分配
This commit is contained in:
@@ -21,6 +21,7 @@ import com.google.common.collect.Maps;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -180,4 +181,11 @@ public class LineInfoDAO {
|
||||
List<LineInfoDO> lineMobile = lineInfoMapper.getLineMobile(lineIds);
|
||||
return lineMobile.stream().filter(o->StringUtils.isNotBlank(o.getMobile())).collect(Collectors.toMap(LineInfoDO::getId, LineInfoDO::getMobile, (k1, k2)-> k1));
|
||||
}
|
||||
|
||||
public Integer batchUpdateInvestmentManager( List<Long> lineIds, Integer status, String investmentManager){
|
||||
if(CollectionUtils.isEmpty(lineIds)|| status == null|| StringUtils.isBlank(investmentManager)){
|
||||
return 0;
|
||||
}
|
||||
return lineInfoMapper.batchUpdateInvestmentManager(lineIds, status, investmentManager);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,4 +104,15 @@ public interface LineInfoMapper extends Mapper<LineInfoDO> {
|
||||
* @return
|
||||
*/
|
||||
List<LineInfoDO> getLineMobile(@Param("lineIds") List<Long> lineIds);
|
||||
|
||||
/**
|
||||
* 批量更新招商经理与线索状态
|
||||
* @param lineIds
|
||||
* @param status
|
||||
* @param investmentManager
|
||||
* @return
|
||||
*/
|
||||
Integer batchUpdateInvestmentManager(@Param("lineIds") List<Long> lineIds,
|
||||
@Param("status") Integer status,
|
||||
@Param("investmentManager") String investmentManager);
|
||||
}
|
||||
@@ -567,4 +567,11 @@
|
||||
</select>
|
||||
|
||||
|
||||
<update id="batchUpdateInvestmentManager">
|
||||
update xfsg_line_info set line_status = #{status} and investment_manager = #{investmentManager} where id in
|
||||
<foreach collection="lineIds" item="lineId" open="(" separator="," close=")">
|
||||
#{lineId}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.cool.store.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author suzhuhong
|
||||
* @Date 2024/7/19 16:15
|
||||
* @Version 1.0
|
||||
*/
|
||||
@Data
|
||||
public class DistributionInvestmentRequest {
|
||||
|
||||
private String investmentManagerId;
|
||||
|
||||
private List<Long> lineIds;
|
||||
|
||||
}
|
||||
@@ -75,11 +75,11 @@ public interface LineService {
|
||||
|
||||
/**
|
||||
* 将线索从未分配转为已分配 线索变为私海线索
|
||||
* @param changeInvestmentRequest
|
||||
* @param distributionInvestmentRequest
|
||||
* @param userInfo
|
||||
* @return
|
||||
*/
|
||||
Boolean distributionLine(ChangeInvestmentRequest changeInvestmentRequest,LoginUserInfo userInfo);
|
||||
Boolean distributionLine(DistributionInvestmentRequest distributionInvestmentRequest,LoginUserInfo userInfo);
|
||||
|
||||
/**
|
||||
* 线索的各节点情况
|
||||
|
||||
@@ -335,21 +335,13 @@ public class LineServiceImpl implements LineService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean distributionLine(ChangeInvestmentRequest changeInvestmentRequest, LoginUserInfo userInfo) {
|
||||
log.info("changeJoinMode request={}",JSONObject.toJSONString(changeInvestmentRequest));
|
||||
if (changeInvestmentRequest.getLineId()==null||changeInvestmentRequest.getInvestmentManagerId()==null){
|
||||
public Boolean distributionLine(DistributionInvestmentRequest request, LoginUserInfo userInfo) {
|
||||
log.info("changeJoinMode request={}",JSONObject.toJSONString(request));
|
||||
if (CollectionUtils.isEmpty(request.getLineIds())||request.getInvestmentManagerId()==null){
|
||||
throw new ServiceException(ErrorCodeEnum.PARAMS_REQUIRED);
|
||||
}
|
||||
//查询线索
|
||||
LineInfoDO lineInfo = lineInfoDAO.getLineInfo(changeInvestmentRequest.getLineId());
|
||||
if (lineInfo==null){
|
||||
throw new ServiceException(ErrorCodeEnum.LINE_ID_IS_NOT_EXIST);
|
||||
}
|
||||
lineInfo.setInvestmentManager(changeInvestmentRequest.getInvestmentManagerId());
|
||||
lineInfo.setLineStatus(LineStatusEnum.PRIVATE_SEAS.getCode());
|
||||
lineInfo.setUpdateTime(new Date());
|
||||
lineInfo.setUpdateUserId(userInfo.getUserId());
|
||||
lineInfoDAO.updateLineInfo(lineInfo);
|
||||
//批量更新线索
|
||||
lineInfoDAO.batchUpdateInvestmentManager(request.getLineIds(),LineStatusEnum.PRIVATE_SEAS.getCode(), request.getInvestmentManagerId());
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -155,8 +155,8 @@ public class LineInfoController {
|
||||
|
||||
@ApiOperation("将线索从未分配转为已分配")
|
||||
@PostMapping("/distributionLine")
|
||||
public ResponseResult<Boolean> distributionLine(@RequestBody ChangeInvestmentRequest changeInvestmentRequest) {
|
||||
return ResponseResult.success(lineService.distributionLine(changeInvestmentRequest,CurrentUserHolder.getUser()));
|
||||
public ResponseResult<Boolean> distributionLine(@RequestBody DistributionInvestmentRequest distributionInvestmentRequest) {
|
||||
return ResponseResult.success(lineService.distributionLine(distributionInvestmentRequest,CurrentUserHolder.getUser()));
|
||||
}
|
||||
|
||||
@ApiOperation("跳过意向金")
|
||||
|
||||
Reference in New Issue
Block a user