Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
aroad_aqsc
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
许言琪
aroad_aqsc
Commits
e0d6536d
提交
e0d6536d
authored
5月 05, 2019
作者:
宋文杰
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(info information): add save info information
上级
0e110f94
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
86 行增加
和
21 行删除
+86
-21
InfoInformationsController.java
...ad/module/info/controller/InfoInformationsController.java
+10
-16
InfoInformations.java
...ork/galaxy/aroad/module/info/entity/InfoInformations.java
+9
-4
InfoInformationsMapper.java
...laxy/aroad/module/info/mapper/InfoInformationsMapper.java
+8
-1
InfoInformationsService.java
...xy/aroad/module/info/service/InfoInformationsService.java
+10
-0
InfoInformationsServiceImpl.java
...module/info/service/impl/InfoInformationsServiceImpl.java
+40
-0
InfoInformationsMapper.xml
src/main/resources/mapper/info/InfoInformationsMapper.xml
+7
-0
InfoTemplatesMapper.xml
src/main/resources/mapper/info/InfoTemplatesMapper.xml
+2
-0
没有找到文件。
src/main/java/com/elephant/framework/galaxy/aroad/module/info/controller/InfoInformationsController.java
浏览文件 @
e0d6536d
...
...
@@ -2,11 +2,13 @@ package com.elephant.framework.galaxy.aroad.module.info.controller;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.elephant.framework.galaxy.aroad.module.info.dto.InfoInformationsDto
;
import
com.elephant.framework.galaxy.aroad.response.R
;
import
com.elephant.framework.galaxy.aroad.module.common.annotation.SysLog
;
import
com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations
;
import
com.elephant.framework.galaxy.aroad.module.info.service.InfoInformationsService
;
import
lombok.AllArgsConstructor
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
com.elephant.framework.galaxy.aroad.module.common.controller.BaseController
;
...
...
@@ -46,27 +48,19 @@ public class InfoInformationsController extends BaseController {
return
new
R
<>(
infoInformationsService
.
getById
(
infoId
));
}
/**
* 新增信息表
* @param infoInformations 信息表
* @return R
* @Description: 新增上报信息
* @Param: [info]
* @return: com.elephant.framework.galaxy.aroad.response.R
* @Author: songwenjie
* @Date: 2019/5/5
*/
@SysLog
(
"新增信息表"
)
@PostMapping
public
R
save
(
@RequestBody
InfoInformations
infoInformations
){
return
new
R
<>(
infoInformationsService
.
save
(
infoInformations
));
public
R
save
Informations
(
@RequestBody
InfoInformationsDto
info
){
return
new
R
<>(
infoInformationsService
.
save
Informations
(
info
));
}
/**
* 修改信息表
* @param infoInformations 信息表
* @return R
*/
@SysLog
(
"修改信息表"
)
@PutMapping
public
R
updateById
(
@RequestBody
InfoInformations
infoInformations
){
return
new
R
<>(
infoInformationsService
.
updateById
(
infoInformations
));
}
/**
* 通过id删除信息表
...
...
src/main/java/com/elephant/framework/galaxy/aroad/module/info/entity/InfoInformations.java
浏览文件 @
e0d6536d
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
info
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.extension.activerecord.Model
;
import
lombok.
Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.
*
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
import
java.util.Date
;
/**
* 信息表
...
...
@@ -15,15 +17,18 @@ import java.time.LocalDateTime;
* @date 2019-04-28 10:34:46
*/
@Data
@Builder
@TableName
(
"info_informations"
)
@EqualsAndHashCode
(
callSuper
=
true
)
@NoArgsConstructor
@AllArgsConstructor
public
class
InfoInformations
extends
Model
<
InfoInformations
>
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 信息id
*/
@TableId
@TableId
(
type
=
IdType
.
AUTO
)
private
Integer
infoId
;
/**
* 模板id
...
...
@@ -48,6 +53,6 @@ private static final long serialVersionUID = 1L;
/**
* 上报时间
*/
private
LocalDateTim
e
reportingTime
;
private
Dat
e
reportingTime
;
}
src/main/java/com/elephant/framework/galaxy/aroad/module/info/mapper/InfoInformationsMapper.java
浏览文件 @
e0d6536d
...
...
@@ -10,5 +10,12 @@ import com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations;
* @date 2019-04-28 10:34:46
*/
public
interface
InfoInformationsMapper
extends
BaseMapper
<
InfoInformations
>
{
/**
* @Description: 新增上报信息
* @Param: [informations]
* @return: java.lang.Boolean
* @Author: songwenjie
* @Date: 2019/5/5
*/
Boolean
saveInformations
(
InfoInformations
informations
);
}
src/main/java/com/elephant/framework/galaxy/aroad/module/info/service/InfoInformationsService.java
浏览文件 @
e0d6536d
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
info
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.elephant.framework.galaxy.aroad.module.info.dto.InfoInformationsDto
;
import
com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* 信息表
...
...
@@ -11,4 +13,12 @@ import com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations;
*/
public
interface
InfoInformationsService
extends
IService
<
InfoInformations
>
{
/**
* @Description: 新增上报信息
* @Param: [info]
* @return: java.lang.Boolean
* @Author: songwenjie
* @Date: 2019/5/5
*/
Boolean
saveInformations
(
InfoInformationsDto
info
);
}
src/main/java/com/elephant/framework/galaxy/aroad/module/info/service/impl/InfoInformationsServiceImpl.java
浏览文件 @
e0d6536d
package
com
.
elephant
.
framework
.
galaxy
.
aroad
.
module
.
info
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.elephant.framework.galaxy.aroad.module.info.dto.InfoInformationsDto
;
import
com.elephant.framework.galaxy.aroad.module.info.entity.InfoInformations
;
import
com.elephant.framework.galaxy.aroad.module.info.entity.InfoReceivers
;
import
com.elephant.framework.galaxy.aroad.module.info.mapper.InfoInformationsMapper
;
import
com.elephant.framework.galaxy.aroad.module.info.service.InfoInformationsService
;
import
com.elephant.framework.galaxy.aroad.module.info.service.InfoReceiversService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 信息表
...
...
@@ -15,4 +23,36 @@ import org.springframework.stereotype.Service;
@Service
public
class
InfoInformationsServiceImpl
extends
ServiceImpl
<
InfoInformationsMapper
,
InfoInformations
>
implements
InfoInformationsService
{
@Autowired
private
InfoReceiversService
infoReceiversService
;
/**
* @Description: 新增上报信息
* @Param: [info]
* @return: java.lang.Boolean
* @Author: songwenjie
* @Date: 2019/5/5
*/
@Transactional
public
Boolean
saveInformations
(
InfoInformationsDto
info
){
InfoInformations
information
=
InfoInformations
.
builder
()
.
templateId
(
info
.
getTemplateId
())
.
infoTitle
(
info
.
getInfoTitle
())
.
infoContent
(
info
.
getInfoContent
())
.
infoRemark
(
info
.
getInfoRemark
())
.
reporterId
(
info
.
getReporterId
())
.
reportingTime
(
info
.
getReportingTime
())
.
build
();
baseMapper
.
saveInformations
(
information
);
List
<
InfoReceivers
>
receivers
=
new
ArrayList
<>();
info
.
getReceiverIds
().
forEach
(
r
->{
receivers
.
add
(
InfoReceivers
.
builder
()
.
infoId
(
information
.
getInfoId
())
.
deptId
(
info
.
getDeptId
())
.
receiverId
(
r
)
.
build
());
});
return
infoReceiversService
.
saveBatch
(
receivers
);
}
}
src/main/resources/mapper/info/InfoInformationsMapper.xml
浏览文件 @
e0d6536d
...
...
@@ -13,4 +13,11 @@
<result
property=
"reporterId"
column=
"reporter_id"
/>
<result
property=
"reportingTime"
column=
"reporting_time"
/>
</resultMap>
<insert
id=
"saveInformations"
useGeneratedKeys=
"true"
keyProperty=
"infoId"
>
insert into
info_informations(template_id, info_title,info_content,info_remark,reporter_id,reporting_time)
values
(#{templateId}, #{infoTitle},#{infoContent},#{infoRemark},#{reporterId},#{reportingTime})
</insert>
</mapper>
src/main/resources/mapper/info/InfoTemplatesMapper.xml
浏览文件 @
e0d6536d
...
...
@@ -18,4 +18,6 @@
select * from info_templates
where create_dept_id = #{createDeptId}
</select>
</mapper>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论