Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
bd425e6f
提交
bd425e6f
authored
10月 21, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[修改bug]修改报废、更新列装库等bug、添加事务
上级
f5bee343
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
53 行增加
和
1 行删除
+53
-1
SystemVariableServiceImpl.java
...kj/dev/config/service/impl/SystemVariableServiceImpl.java
+1
-0
DeviceLibraryDao.java
.../tykj/dev/device/library/repository/DeviceLibraryDao.java
+1
-0
pom.xml
dev-packing/pom.xml
+5
-0
PackingLibraryController.java
...v/device/packing/controller/PackingLibraryController.java
+32
-0
DeviceScrapController.java
...kj/dev/device/scrap/controller/DeviceScrapController.java
+3
-1
SelfCheckSchedulerTask.java
...ykj/dev/device/selfcheck/base/SelfCheckSchedulerTask.java
+2
-0
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+4
-0
StorageBillController.java
.../dev/device/storage/controller/StorageBillController.java
+3
-0
DeviceUseReportController.java
...evice/usereport/controller/DeviceUseReportController.java
+2
-0
没有找到文件。
dev-config/src/main/java/com/tykj/dev/config/service/impl/SystemVariableServiceImpl.java
浏览文件 @
bd425e6f
...
...
@@ -27,6 +27,7 @@ public class SystemVariableServiceImpl implements SystemVariableService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
SystemVariable
setVaule
(
String
name
,
String
vaule
)
{
SystemVariable
systemVariable
=
systemVariableDao
.
findByName
(
name
);
systemVariable
.
setVaule
(
vaule
);
...
...
dev-library/src/main/java/com/tykj/dev/device/library/repository/DeviceLibraryDao.java
浏览文件 @
bd425e6f
...
...
@@ -53,4 +53,5 @@ public interface DeviceLibraryDao extends JpaRepository<DeviceLibrary, Integer>,
@Query
(
"select o from DeviceLibrary o where o.ownUnit= :unitName and o.createTime >= :startTime and o.createTime <= :endTime"
)
List
<
DeviceLibrary
>
findAllByUnitBetweenTime
(
String
unitName
,
Date
startTime
,
Date
endTime
);
List
<
DeviceLibrary
>
getAllByPackingId
(
Integer
packingId
);
}
dev-packing/pom.xml
浏览文件 @
bd425e6f
...
...
@@ -29,6 +29,10 @@
<groupId>
com.tykj.dev
</groupId>
<artifactId>
config
</artifactId>
</dependency>
<dependency>
<groupId>
com.tykj
</groupId>
<artifactId>
dev-library
</artifactId>
</dependency>
</dependencies>
</project>
\ No newline at end of file
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingLibraryController.java
浏览文件 @
bd425e6f
package
com
.
tykj
.
dev
.
device
.
packing
.
controller
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.library.repository.DeviceLibraryDao
;
import
com.tykj.dev.device.library.service.DeviceLibraryService
;
import
com.tykj.dev.device.library.subject.domin.DeviceLibrary
;
import
com.tykj.dev.device.packing.service.PackingLibraryService
;
import
com.tykj.dev.device.packing.subject.domin.PackingLibrary
;
import
com.tykj.dev.device.packing.subject.vo.PackingEditVo
;
...
...
@@ -17,6 +20,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -31,6 +35,12 @@ public class PackingLibraryController {
@Autowired
PackingLibraryService
packingLibraryService
;
@Autowired
DeviceLibraryDao
deviceLibraryDao
;
@Autowired
DeviceLibraryService
deviceLibraryService
;
@ApiOperation
(
value
=
"列装库分页查询"
,
notes
=
"可以通过这个接口进行列装查询"
)
@PostMapping
(
"/serve/summary"
)
public
ResponseEntity
getPage
(
@RequestBody
PackingLibrarySelectVo
packingLibrarySelectVo
)
{
...
...
@@ -71,6 +81,11 @@ public class PackingLibraryController {
PackingLibrary
packingLibraryEntity
=
packingLibraryService
.
getOne
(
packingEditVo
.
getPackingId
());
//获取配件列装
List
<
PackingLibrary
>
packingLibraries
=
packingLibraryService
.
selectAllPart
(
packingEditVo
.
getPackingId
());
//获取该列装所有装备
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
getAllByPackingId
(
packingEditVo
.
getPackingId
());
//获取所有列装配件装备
List
<
DeviceLibrary
>
deviceLibraryList
=
new
ArrayList
<>();
packingLibraries
.
forEach
(
packingLibrary
->
deviceLibraryList
.
addAll
(
deviceLibraryDao
.
getAllByPackingId
(
packingLibrary
.
getId
())));
PackingLibraryUpdateVo
p
=
packingEditVo
.
getUpdateVoList
();
if
(
p
.
getApplyType
()
!=
null
)
{
packingLibraryEntity
.
setApplyType
(
p
.
getApplyType
());
...
...
@@ -99,16 +114,22 @@ public class PackingLibraryController {
if
(
p
.
getInvisibleRange
()
!=
null
)
{
packingLibraryEntity
.
setInvisibleRange
(
p
.
getInvisibleRange
());
packingLibraries
.
forEach
(
packingLibrary
->
packingLibrary
.
setInvisibleRange
(
p
.
getInvisibleRange
()));
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setInvisibleRange
(
p
.
getInvisibleRange
()));
deviceLibraryList
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setInvisibleRange
(
p
.
getInvisibleRange
()));
}
if
(
p
.
getMatchingRange
()
!=
null
)
{
packingLibraryEntity
.
setMatchingRange
(
p
.
getMatchingRange
());
packingLibraries
.
forEach
(
packingLibrary
->
packingLibrary
.
setMatchingRange
(
p
.
getMatchingRange
()));
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setMatchingRange
(
p
.
getMatchingRange
()));
deviceLibraryList
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setMatchingRange
(
p
.
getMatchingRange
()));
}
if
(
p
.
getModel
()
!=
null
)
{
packingLibraryEntity
.
setModel
(
p
.
getModel
());
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setModel
(
p
.
getModel
()));
}
if
(
p
.
getName
()
!=
null
)
{
packingLibraryEntity
.
setName
(
p
.
getName
());
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setName
(
p
.
getName
()));
}
if
(
p
.
getNature
()
!=
null
)
{
packingLibraryEntity
.
setNature
(
p
.
getNature
());
...
...
@@ -125,6 +146,8 @@ public class PackingLibraryController {
if
(
p
.
getSecretLevel
()
!=
null
)
{
packingLibraryEntity
.
setSecretLevel
(
p
.
getSecretLevel
());
packingLibraries
.
forEach
(
packingLibrary
->
packingLibrary
.
setSecretLevel
(
p
.
getSecretLevel
()));
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setSecretLevel
(
p
.
getSecretLevel
()));
deviceLibraryList
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setSecretLevel
(
p
.
getSecretLevel
()));
}
if
(
p
.
getStatus
()
!=
null
)
{
packingLibraryEntity
.
setStatus
(
p
.
getStatus
());
...
...
@@ -132,24 +155,33 @@ public class PackingLibraryController {
}
if
(
p
.
getType
()
!=
null
)
{
packingLibraryEntity
.
setType
(
p
.
getType
());
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setType
(
p
.
getType
()));
}
packingLibraryService
.
update
(
packingLibraryEntity
);
packingLibraries
.
forEach
(
packingLibrary
->
packingLibraryService
.
update
(
packingLibrary
));
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibraryService
.
update
(
deviceLibrary
));
deviceLibraryList
.
forEach
(
deviceLibrary
->
deviceLibraryService
.
update
(
deviceLibrary
));
}
//更新配件信息
if
(
packingEditVo
.
getPartUpdateVoList
()!=
null
){
packingEditVo
.
getPartUpdateVoList
().
forEach
(
packingLibraryUpdateVo
->
{
if
(
packingLibraryUpdateVo
.
getPackingId
()
>
0
){
PackingLibrary
packingLibrary
=
packingLibraryService
.
getOne
(
packingLibraryUpdateVo
.
getPackingId
());
//获取该配件所有装备
List
<
DeviceLibrary
>
deviceLibraries
=
deviceLibraryDao
.
getAllByPackingId
(
packingLibraryUpdateVo
.
getPackingId
());
if
(
packingLibraryUpdateVo
.
getModel
()!=
null
){
packingLibrary
.
setModel
(
packingLibraryUpdateVo
.
getModel
());
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setModel
(
packingLibraryUpdateVo
.
getModel
()));
}
if
(
packingLibraryUpdateVo
.
getName
()!=
null
){
packingLibrary
.
setName
(
packingLibraryUpdateVo
.
getName
());
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setName
(
packingLibraryUpdateVo
.
getName
()));
}
if
(
packingLibraryUpdateVo
.
getType
()!=
null
){
packingLibrary
.
setType
(
packingLibraryUpdateVo
.
getType
());
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibrary
.
setType
(
packingLibraryUpdateVo
.
getType
()));
}
deviceLibraries
.
forEach
(
deviceLibrary
->
deviceLibraryService
.
update
(
deviceLibrary
));
packingLibraryService
.
update
(
packingLibrary
);
}
});
...
...
dev-scrap/src/main/java/com/tykj/dev/device/scrap/controller/DeviceScrapController.java
浏览文件 @
bd425e6f
...
...
@@ -12,6 +12,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
...
...
@@ -54,6 +55,7 @@ public class DeviceScrapController {
@ApiOperation
(
value
=
"提交报废单"
,
notes
=
"提交报废单"
)
@PostMapping
(
value
=
"/form"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
commitScrap
(
@RequestBody
ScrapSaveVo
scrapSaveVo
)
{
//转实体类
ScrapBill
scrapBill
=
scrapSaveVo
.
toDo
();
...
...
@@ -66,7 +68,7 @@ public class DeviceScrapController {
//计算所有不同的名称
Set
<
String
>
names
=
scrapSaveVo
.
getDeviceIds
().
stream
().
map
(
integer
->
deviceLibraryService
.
getOne
(
integer
).
getName
()).
collect
(
Collectors
.
toSet
());
StringBuffer
stringBuffer2
=
new
StringBuffer
();
model
s
.
forEach
(
s
->
stringBuffer2
.
append
(
s
).
append
(
","
));
name
s
.
forEach
(
s
->
stringBuffer2
.
append
(
s
).
append
(
","
));
stringBuffer2
.
deleteCharAt
(
stringBuffer2
.
length
()
-
1
);
scrapBill
.
setNames
(
stringBuffer2
.
toString
());
ScrapBill
scrapBill1
=
scrapBillService
.
add
(
scrapBill
);
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/base/SelfCheckSchedulerTask.java
浏览文件 @
bd425e6f
...
...
@@ -21,6 +21,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler
;
import
org.springframework.scheduling.support.CronTrigger
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.InvocationHandler
;
...
...
@@ -96,6 +97,7 @@ public class SelfCheckSchedulerTask {
public
class
SelfCheckTask
implements
Runnable
{
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
run
()
{
if
(
unitsDao
!=
null
&&
taskService
!=
null
&&
selfCheckBillService
!=
null
)
{
List
<
Units
>
unitsList
=
unitsDao
.
findAll
();
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
bd425e6f
...
...
@@ -40,6 +40,7 @@ import org.springframework.scheduling.annotation.SchedulingConfigurer;
import
org.springframework.scheduling.config.ScheduledTaskRegistrar
;
import
org.springframework.scheduling.config.Task
;
import
org.springframework.scheduling.support.CronTrigger
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.Field
;
...
...
@@ -132,6 +133,7 @@ public class SelfCheckController {
@ApiOperation
(
value
=
"设置自查周期"
,
notes
=
"可以通过这个接口设置自查周期"
)
@PostMapping
(
value
=
"/set/cycle/{type}"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
setCycle
(
@PathVariable
(
"type"
)
int
type
){
if
(
selfCheckSchedulerTask
!=
null
)
{
switch
(
type
)
{
...
...
@@ -253,6 +255,7 @@ public class SelfCheckController {
@ApiOperation
(
value
=
"发起自查业务"
,
notes
=
"可以通过这个接口发起自查业务"
)
@PostMapping
(
value
=
"/addBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addSelfExaminationBill
(
@RequestBody
SelfCheckSaveVo
selfCheckSaveVo
)
{
//添加账单
SelfCheckBill
selfExaminationBillEntity
;
...
...
@@ -319,6 +322,7 @@ public class SelfCheckController {
@ApiOperation
(
value
=
"自查审核"
,
notes
=
"可以通过这个接口自查审核"
)
@PatchMapping
(
value
=
"/selfExaminationConfirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
selfExaminationConfirm
(
@RequestBody
SelfCheckConfirmVo
selfCheckConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
selfCheckConfirmVo
.
getTaskId
());
SelfCheckBill
selfExaminationBillEntity
=
selfExaminationBillService
.
getOne
(
taskBto
.
getBillId
());
...
...
dev-storage/src/main/java/com/tykj/dev/device/storage/controller/StorageBillController.java
浏览文件 @
bd425e6f
...
...
@@ -30,6 +30,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
...
...
@@ -111,6 +112,7 @@ public class StorageBillController {
@ApiOperation
(
value
=
"添加入库单"
,
notes
=
"可以通过这个接口发起入库业务"
)
@PostMapping
(
value
=
"/addStorageBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addStorageBill
(
@RequestBody
StorageBillSaveVo
storageBillSaveVo
)
{
//1.存入库单
Integer
userId
=
userUtils
.
getCurrentUserId
();
...
...
@@ -172,6 +174,7 @@ public class StorageBillController {
@ApiOperation
(
value
=
"入库审核"
,
notes
=
"可以通过这个接口入库审核"
)
@PostMapping
(
value
=
"/confirmStorageBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
confirmStorageBill
(
@RequestBody
StorageBillConfirmVo
storageBillConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
storageBillConfirmVo
.
getTaskId
());
//1.审核成功,入库任务结束,发起新的确认任务,改变装备状态
...
...
dev-usereport/src/main/java/com/tykj/dev/device/usereport/controller/DeviceUseReportController.java
浏览文件 @
bd425e6f
...
...
@@ -17,6 +17,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -50,6 +51,7 @@ public class DeviceUseReportController {
@ApiOperation
(
value
=
"生成装备使用报告"
,
notes
=
"可以通过这个接口生成装备使用报告"
)
@PostMapping
(
"/create"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
createDeviceUseReport
(
@RequestBody
DeviceUseReportCreateVo
deviceUseReportCreateVo
)
{
return
ResultUtil
.
success
(
deviceUseReportService
.
createReport
(
deviceUseReportCreateVo
));
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论