Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
项目练习
黑马程序员-CRM
汇课CRM管理系统-后端
提交
6ad41bbc
汇
汇课CRM管理系统-后端
项目概览
项目练习
/
黑马程序员-CRM
/
汇课CRM管理系统-后端
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
汇
汇课CRM管理系统-后端
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
6ad41bbc
编写于
8月 30, 2022
作者:
Hello 码上秃
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
功能开发__商机跟进
上级
62daea03
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
201 addition
and
13 deletion
+201
-13
huike-admin/src/main/java/com/huike/web/controller/business/TbBusinessController.java
...m/huike/web/controller/business/TbBusinessController.java
+6
-2
huike-admin/src/main/java/com/huike/web/controller/business/TbBusinessTrackRecordController.java
.../controller/business/TbBusinessTrackRecordController.java
+10
-4
huike-business/src/main/java/com/huike/business/mapper/TbBusinessMapper.java
...main/java/com/huike/business/mapper/TbBusinessMapper.java
+3
-0
huike-business/src/main/java/com/huike/business/mapper/TbBusinessTrackRecordMapper.java
...om/huike/business/mapper/TbBusinessTrackRecordMapper.java
+21
-0
huike-business/src/main/java/com/huike/business/service/ITbBusinessService.java
...n/java/com/huike/business/service/ITbBusinessService.java
+2
-0
huike-business/src/main/java/com/huike/business/service/ITbBusinessTrackRecordService.java
...huike/business/service/ITbBusinessTrackRecordService.java
+17
-1
huike-business/src/main/java/com/huike/business/service/impl/TbBusinessServiceImpl.java
...om/huike/business/service/impl/TbBusinessServiceImpl.java
+25
-6
huike-business/src/main/java/com/huike/business/service/impl/TbBusinessTrackRecordServiceImpl.java
...siness/service/impl/TbBusinessTrackRecordServiceImpl.java
+43
-0
huike-business/src/main/resources/mapper/business/TbBusinessMapper.xml
...s/src/main/resources/mapper/business/TbBusinessMapper.xml
+9
-0
huike-business/src/main/resources/mapper/business/TbBusinessTrackRecordMapper.xml
...resources/mapper/business/TbBusinessTrackRecordMapper.xml
+65
-0
未找到文件。
huike-admin/src/main/java/com/huike/web/controller/business/TbBusinessController.java
浏览文件 @
6ad41bbc
...
...
@@ -140,6 +140,10 @@ public class TbBusinessController extends BaseController {
return
AjaxResult
.
success
(
tbBusinessService
.
gain
(
assignmentVo
.
getIds
(),
assignmentVo
.
getUserId
()));
}
@PreAuthorize
(
"@ss.hasPermi('business:business:back')"
)
@Log
(
title
=
"退回公海"
,
businessType
=
BusinessType
.
UPDATE
)
@PutMapping
(
"/back/{id}/{status}"
)
public
AjaxResult
back
(
@PathVariable
(
"id"
)
Long
id
,
@PathVariable
(
"status"
)
String
status
)
{
return
AjaxResult
.
success
(
tbBusinessService
.
back
(
id
,
status
));
}
}
\ No newline at end of file
huike-admin/src/main/java/com/huike/web/controller/business/TbBusinessTrackRecordController.java
浏览文件 @
6ad41bbc
...
...
@@ -40,23 +40,29 @@ public class TbBusinessTrackRecordController extends BaseController {
@Autowired
private
ISysDictDataService
sysDictDataService
;
/**
* 查询商机跟进记录列表
* @param id 商机ID
* @return AjaxResult
*/
@PreAuthorize
(
"@ss.hasPermi('business:record:list')"
)
@GetMapping
(
"/list"
)
public
AjaxResult
list
(
@RequestParam
(
"businessId"
)
Long
id
)
{
public
AjaxResult
list
(
@RequestParam
(
"businessId"
)
Long
id
)
{
return
null
;
return
AjaxResult
.
success
(
tbBusinessTrackRecordService
.
getByBusinessId
(
id
))
;
}
/**
* 新增商机跟进记录
* @param businessTrackVo 商机跟进记录信息
* @return AjaxResult
*/
@PreAuthorize
(
"@ss.hasPermi('business:record:add')"
)
@Log
(
title
=
"商机跟进记录"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
public
AjaxResult
add
(
@RequestBody
BusinessTrackVo
businessTrackVo
){
return
null
;
public
AjaxResult
add
(
@RequestBody
BusinessTrackVo
businessTrackVo
)
{
return
toAjax
(
tbBusinessTrackRecordService
.
add
(
businessTrackVo
))
;
}
}
\ No newline at end of file
huike-business/src/main/java/com/huike/business/mapper/TbBusinessMapper.java
浏览文件 @
6ad41bbc
...
...
@@ -79,4 +79,7 @@ public interface TbBusinessMapper {
public
void
updateBusinessEndTimeById
(
@Param
(
"id"
)
Long
id
,
@Param
(
"endTime"
)
Date
endTime
);
int
back
(
@Param
(
"id"
)
Long
id
,
@Param
(
"status"
)
String
status
);
List
<
Map
<
String
,
String
>>
getSysDictData
();
}
huike-business/src/main/java/com/huike/business/mapper/TbBusinessTrackRecordMapper.java
浏览文件 @
6ad41bbc
package
com.huike.business.mapper
;
import
java.util.List
;
import
com.huike.business.domain.TbBusiness
;
import
com.huike.business.domain.TbBusinessTrackRecord
;
/**
...
...
@@ -9,4 +11,23 @@ import com.huike.business.domain.TbBusinessTrackRecord;
*/
public
interface
TbBusinessTrackRecordMapper
{
/**
* 更新商机中的客户信息
* @param tbBusiness 商机信息
* @return Integer
*/
Integer
updateTbBusinessById
(
TbBusiness
tbBusiness
);
/** 新增商机跟进记录
* @param tbBusinessTrackRecord 商机跟进记录
* @return Integer
*/
Integer
addTbBusinessTrackRecord
(
TbBusinessTrackRecord
tbBusinessTrackRecord
);
/**
* 查询商机跟进记录列表
* @param id 商机ID
* @return TbBusinessTrackRecord 商机跟进记录列表
*/
List
<
TbBusinessTrackRecord
>
getByBusinessId
(
Long
id
);
}
\ No newline at end of file
huike-business/src/main/java/com/huike/business/service/ITbBusinessService.java
浏览文件 @
6ad41bbc
...
...
@@ -73,4 +73,6 @@ public interface ITbBusinessService
public
int
changeBusiness
(
Long
clueId
);
public
int
updateStatus
(
Long
id
,
String
status
);
int
back
(
Long
id
,
String
status
);
}
huike-business/src/main/java/com/huike/business/service/ITbBusinessTrackRecordService.java
浏览文件 @
6ad41bbc
package
com.huike.business.service
;
import
com.huike.business.domain.TbBusinessTrackRecord
;
import
com.huike.business.domain.vo.BusinessTrackVo
;
import
java.util.List
;
/**
* 商机跟进记录Service接口
* @date 2021-04-28
*/
public
interface
ITbBusinessTrackRecordService
{
/**
* 新增商机跟进记录
* @param businessTrackVo 商机跟进记录信息
* @return AjaxResult
*/
Integer
add
(
BusinessTrackVo
businessTrackVo
);
/**
* 查询商机跟进记录列表
* @param id 商机ID
* @return TbBusinessTrackRecord 商机跟进记录列表
*/
List
<
TbBusinessTrackRecord
>
getByBusinessId
(
Long
id
);
}
huike-business/src/main/java/com/huike/business/service/impl/TbBusinessServiceImpl.java
浏览文件 @
6ad41bbc
...
...
@@ -2,7 +2,10 @@ package com.huike.business.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
com.huike.business.domain.TbBusinessTrackRecord
;
import
com.huike.business.strategy.Rule
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -66,7 +69,7 @@ public class TbBusinessServiceImpl implements ITbBusinessService {
/**
* 查询商机
*
*
* @param id 商机ID
* @return 商机
*/
...
...
@@ -78,7 +81,7 @@ public class TbBusinessServiceImpl implements ITbBusinessService {
/**
* 查询商机列表
*
*
* @param tbBusiness 商机
* @return 商机
*/
...
...
@@ -97,7 +100,7 @@ public class TbBusinessServiceImpl implements ITbBusinessService {
/**
* 新增商机
*
*
* @param tbBusiness 商机
* @return 结果
*/
...
...
@@ -126,7 +129,7 @@ public class TbBusinessServiceImpl implements ITbBusinessService {
/**
* 修改商机
*
*
* @param tbBusiness 商机
* @return 结果
*/
...
...
@@ -138,7 +141,7 @@ public class TbBusinessServiceImpl implements ITbBusinessService {
/**
* 批量删除商机
*
*
* @param ids 需要删除的商机ID
* @return 结果
*/
...
...
@@ -150,7 +153,7 @@ public class TbBusinessServiceImpl implements ITbBusinessService {
/**
* 删除商机信息
*
*
* @param id 商机ID
* @return 结果
*/
...
...
@@ -287,4 +290,20 @@ public class TbBusinessServiceImpl implements ITbBusinessService {
public
int
updateStatus
(
Long
clueId
,
String
status
){
return
tbBusinessMapper
.
resetNextTimeAndStatus
(
clueId
,
status
);
}
@Override
@Transactional
public
int
back
(
Long
id
,
String
status
)
{
List
<
Map
<
String
,
String
>>
sysDictData
=
tbBusinessMapper
.
getSysDictData
();
Map
<
String
,
String
>
collect
=
sysDictData
.
stream
().
collect
(
Collectors
.
toMap
(
item
->
item
.
get
(
"status"
),
item
->
item
.
get
(
"statusMsg"
)));
TbBusinessTrackRecord
tbBusinessTrackRecord
=
new
TbBusinessTrackRecord
();
tbBusinessTrackRecord
.
setRecord
(
"退回公海: "
+
collect
.
get
(
status
));
tbBusinessTrackRecord
.
setBusinessId
(
id
);
tbBusinessTrackRecord
.
setCreateBy
(
SecurityUtils
.
getUsername
());
tbBusinessTrackRecord
.
setCreateTime
(
new
Date
(
System
.
currentTimeMillis
()));
tbBusinessTrackRecordMapper
.
addTbBusinessTrackRecord
(
tbBusinessTrackRecord
);
return
tbBusinessMapper
.
back
(
id
,
status
);
}
}
huike-business/src/main/java/com/huike/business/service/impl/TbBusinessTrackRecordServiceImpl.java
浏览文件 @
6ad41bbc
package
com.huike.business.service.impl
;
import
com.huike.business.domain.TbBusiness
;
import
com.huike.business.domain.TbBusinessTrackRecord
;
import
com.huike.business.domain.vo.BusinessTrackVo
;
import
com.huike.business.mapper.TbBusinessTrackRecordMapper
;
import
com.huike.business.service.ITbBusinessTrackRecordService
;
import
com.huike.common.utils.SecurityUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 商机跟进记录Service业务层处理
*
...
...
@@ -13,4 +22,38 @@ import org.springframework.stereotype.Service;
@Service
public
class
TbBusinessTrackRecordServiceImpl
implements
ITbBusinessTrackRecordService
{
@Autowired
private
TbBusinessTrackRecordMapper
tbBusinessTrackRecordMapper
;
/**
* 新增商机跟进记录
* @param businessTrackVo 商机跟进记录信息
* @return AjaxResult
*/
@Override
public
Integer
add
(
BusinessTrackVo
businessTrackVo
)
{
TbBusiness
tbBusiness
=
new
TbBusiness
();
TbBusinessTrackRecord
tbBusinessTrackRecord
=
new
TbBusinessTrackRecord
();
BeanUtils
.
copyProperties
(
businessTrackVo
,
tbBusiness
);
tbBusiness
.
setId
(
businessTrackVo
.
getBusinessId
());
// 更新商机中的客户信息
tbBusinessTrackRecordMapper
.
updateTbBusinessById
(
tbBusiness
);
BeanUtils
.
copyProperties
(
businessTrackVo
,
tbBusinessTrackRecord
);
tbBusinessTrackRecord
.
setCreateBy
(
SecurityUtils
.
getUsername
());
// 插入商机跟进记录
return
tbBusinessTrackRecordMapper
.
addTbBusinessTrackRecord
(
tbBusinessTrackRecord
);
}
/**
* 查询商机跟进记录列表
* @param id 商机ID
* @return TbBusinessTrackRecord 商机跟进记录列表
*/
@Override
public
List
<
TbBusinessTrackRecord
>
getByBusinessId
(
Long
id
)
{
return
tbBusinessTrackRecordMapper
.
getByBusinessId
(
id
);
}
}
huike-business/src/main/resources/mapper/business/TbBusinessMapper.xml
浏览文件 @
6ad41bbc
...
...
@@ -302,5 +302,14 @@
update tb_business set end_time=#{endTime},next_time = null where id = #{id}
</update>
<update
id=
"back"
>
update tb_business set next_time= null, status=4 where id = #{id}
</update>
<select
id=
"getSysDictData"
resultType=
"java.util.Map"
>
select dict_value status, dict_label statusMsg
from sys_dict_data
where dict_type = "reasons_for_business_reporting"
</select>
</mapper>
\ No newline at end of file
huike-business/src/main/resources/mapper/business/TbBusinessTrackRecordMapper.xml
浏览文件 @
6ad41bbc
...
...
@@ -15,5 +15,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"nextTime"
column=
"next_time"
/>
</resultMap>
<sql
id=
"selectTbBusinessTrackRecord"
>
select id, business_id, create_by, key_items, record, track_status, create_time, next_time from tb_business_track_record
</sql>
<select
id=
"getByBusinessId"
resultType=
"com.huike.business.domain.TbBusinessTrackRecord"
>
<include
refid=
"selectTbBusinessTrackRecord"
></include>
where business_id = #{id}
</select>
<update
id=
"updateTbBusinessById"
>
update tb_business
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"name != null"
>
name = #{name},
</if>
<if
test=
"phone != null"
>
phone = #{phone},
</if>
<if
test=
"channel != null"
>
channel = #{channel},
</if>
<if
test=
"activityId != null"
>
activity_id = #{activityId},
</if>
<if
test=
"provinces != null"
>
provinces = #{provinces},
</if>
<if
test=
"city != null"
>
city = #{city},
</if>
<if
test=
"sex != null and sex != ''"
>
sex = #{sex},
</if>
<if
test=
"age != null"
>
age = #{age},
</if>
<if
test=
"weixin != null"
>
weixin = #{weixin},
</if>
<if
test=
"qq != null"
>
qq = #{qq},
</if>
<if
test=
"level != null"
>
level = #{level},
</if>
<if
test=
"subject != null"
>
subject = #{subject},
</if>
<if
test=
"courseId != null"
>
course_id = #{courseId},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"occupation != null"
>
occupation = #{occupation},
</if>
<if
test=
"education != null"
>
education = #{education},
</if>
<if
test=
"job != null"
>
job = #{job},
</if>
<if
test=
"salary != null"
>
salary = #{salary},
</if>
<if
test=
"major != null"
>
major = #{major},
</if>
<if
test=
"expectedSalary != null"
>
expected_salary = #{expectedSalary},
</if>
<if
test=
"reasons != null"
>
reasons = #{reasons},
</if>
<if
test=
"plan != null"
>
plan = #{plan},
</if>
<if
test=
"planTime != null"
>
plan_time = #{planTime},
</if>
<if
test=
"otherIntention != null"
>
other_intention = #{otherIntention},
</if>
<if
test=
"nextTime != null"
>
next_time = #{nextTime},
</if>
<if
test=
"status != null"
>
status = #{status},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
</trim>
where id = #{id}
</update>
<insert
id=
"addTbBusinessTrackRecord"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into tb_business_track_record
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"businessId != null and businessId != ''"
>
business_id,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"keyItems != null and keyItems != ''"
>
key_items,
</if>
<if
test=
"record != null and record != ''"
>
record,
</if>
<if
test=
"trackStatus != null and trackStatus != ''"
>
track_status,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"nextTime != null"
>
next_time
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"businessId != null and businessId != ''"
>
#{businessId},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"keyItems != null and keyItems != ''"
>
#{keyItems},
</if>
<if
test=
"record != null and record != ''"
>
#{record},
</if>
<if
test=
"trackStatus != null and trackStatus != ''"
>
#{trackStatus},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"nextTime != null"
>
#{nextTime},
</if>
</trim>
</insert>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录