Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Evan Liu
hms
提交
43685c3a
H
hms
项目概览
Evan Liu
/
hms
通知
10
Star
5
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hms
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
43685c3a
编写于
8月 15, 2021
作者:
N
nrd
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新了查询客户的代码,新增了删除客户的代码
上级
bada1524
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
40 addition
and
11 deletion
+40
-11
HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java
...in/java/com/hqyj/seven/controller/CustomerController.java
+28
-10
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
+2
-0
HMS/src/main/java/com/hqyj/seven/service/CustomerService.java
...src/main/java/com/hqyj/seven/service/CustomerService.java
+2
-0
HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
...java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
+5
-0
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
+3
-1
未找到文件。
HMS/src/main/java/com/hqyj/seven/controller/CustomerController.java
浏览文件 @
43685c3a
...
...
@@ -42,18 +42,21 @@ public class CustomerController {
@RequestMapping
(
"/getonecus"
)
@ResponseBody
public
Map
<
String
,
Object
>
getonecus
(
String
name
){
List
<
Customer
>
customerList
=
customerService
.
queryByCusName
(
name
);
Map
<
String
,
Object
>
customer
=
new
HashMap
<>();
if
(
customerList
==
null
){
customer
.
put
(
"code"
,
0
);
customer
.
put
(
"massage"
,
"没有查询到姓名为"
+
name
+
"的客户信息"
);
}
else
{
customer
.
put
(
"code"
,
1
);
customer
.
put
(
"message"
,
"查询成功"
);
customer
.
put
(
"data"
,
customerList
);
if
(
name
==
null
){
customer
.
put
(
"code"
,-
1
);
customer
.
put
(
"message"
,
"查询名不为空"
);
}
else
{
List
<
Customer
>
customerList
=
customerService
.
queryByCusName
(
name
);
if
(
customerList
==
null
)
{
customer
.
put
(
"code"
,
0
);
customer
.
put
(
"massage"
,
"没有查询到姓名为"
+
name
+
"的客户信息"
);
}
else
{
customer
.
put
(
"code"
,
1
);
customer
.
put
(
"message"
,
"查询成功"
);
customer
.
put
(
"data"
,
customerList
);
}
}
Session
session
=
SecurityUtils
.
getSubject
().
getSession
();
session
.
setAttribute
(
"customerList"
,
customerList
);
return
customer
;
}
@RequestMapping
(
"/updateonecus"
)
...
...
@@ -84,4 +87,19 @@ public class CustomerController {
}
return
customermap
;
}
//客户信息的删除
@RequestMapping
(
"/deleteHouse"
)
@ResponseBody
public
Map
<
String
,
Object
>
deleteHousei
(
int
customer_id
){
Map
<
String
,
Object
>
customermap
=
new
HashMap
<>();
int
num
=
customerService
.
deleteOneCus
(
customer_id
);
if
(
num
==
0
){
customermap
.
put
(
"code"
,
0
);
customermap
.
put
(
"message"
,
"删除失败!"
);
}
else
{
customermap
.
put
(
"code"
,
200
);
customermap
.
put
(
"message"
,
"删除成功!"
);
}
return
customermap
;
}
}
HMS/src/main/java/com/hqyj/seven/dao/CustomerDao.java
浏览文件 @
43685c3a
...
...
@@ -18,4 +18,6 @@ public interface CustomerDao {
int
updataOneCus
(
Customer
customer
);
//插入单个客户的信息
int
insertOneCus
(
Customer
customer
);
//删除单个客户的信息
int
deleteOneCus
(
int
customer_id
);
}
HMS/src/main/java/com/hqyj/seven/service/CustomerService.java
浏览文件 @
43685c3a
...
...
@@ -20,6 +20,8 @@ public interface CustomerService {
int
updataOneCus
(
Customer
customer
);
//插入单个客户的信息
int
insertOneCus
(
Customer
customer
);
//删除单个客户的信息
int
deleteOneCus
(
int
customer_id
);
}
...
...
HMS/src/main/java/com/hqyj/seven/service/impl/CustomerServiceImpl.java
浏览文件 @
43685c3a
...
...
@@ -43,5 +43,10 @@ public class CustomerServiceImpl implements CustomerService {
int
num
=
customerDao
.
insertOneCus
(
customer
);
return
num
;
}
@Override
public
int
deleteOneCus
(
int
customer_id
)
{
int
num
=
customerDao
.
deleteOneCus
(
customer_id
);
return
num
;
}
}
HMS/src/main/resources/mapper/CustomerDaoMapper.xml
浏览文件 @
43685c3a
...
...
@@ -28,5 +28,7 @@
insert into customer(customer_id,name,card,phone,mobile,remainder)
value (#{customer_id},#{name},#{card}, #{phone},#{mobile},#{remainder})
</insert>
<delete
id=
"deleteOneCus"
parameterType=
"com.hqyj.seven.pojo.Customer"
>
delete from customer where customer_id = #{customer_id}
</delete>
</mapper>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录