Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
e7783a53
提交
e7783a53
authored
10月 14, 2020
作者:
邓砥奕
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[事务]添加事务
上级
627d17c5
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
53 行增加
和
90 行删除
+53
-90
AllotBackBillController.java
.../dev/device/allot/controller/AllotBackBillController.java
+4
-0
AllotBillController.java
...tykj/dev/device/allot/controller/AllotBillController.java
+5
-0
AllotBackBillServiceImpl.java
...v/device/allot/service/impl/AllotBackBillServiceImpl.java
+1
-0
AllotBillServiceImpl.java
...j/dev/device/allot/service/impl/AllotBillServiceImpl.java
+1
-3
DeviceApplyController.java
...kj/dev/device/apply/controller/DeviceApplyController.java
+8
-0
DeviceApplyBillServiceImpl.java
...device/apply/service/impl/DeviceApplyBillServiceImpl.java
+1
-0
SystemVariableServiceImpl.java
...kj/dev/config/service/impl/SystemVariableServiceImpl.java
+1
-0
DeviceDestroyController.java
...ev/device/destroy/controller/DeviceDestroyController.java
+4
-13
DeviceLibraryController.java
...ev/device/library/controller/DeviceLibraryController.java
+2
-0
MatchingDeviceController.java
.../device/matching/controller/MatchingDeviceController.java
+6
-10
PackingController.java
...tykj/dev/device/packing/controller/PackingController.java
+4
-9
PackingLibraryController.java
...v/device/packing/controller/PackingLibraryController.java
+2
-0
PackingLibraryServiceImpl.java
...evice/packing/service/impl/PackingLibraryServiceImpl.java
+1
-0
RepairController.java
...m/tykj/dev/device/repair/controller/RepairController.java
+12
-0
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+0
-54
RepairControllerTest.java
...c/test/java/com/tykj/dev/repair/RepairControllerTest.java
+1
-1
没有找到文件。
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBackBillController.java
浏览文件 @
e7783a53
...
...
@@ -27,6 +27,7 @@ import lombok.extern.slf4j.Slf4j;
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.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -75,6 +76,7 @@ public class AllotBackBillController {
@ApiOperation
(
value
=
"发起配发退回业务"
,
notes
=
"可以通过这个接口发起配发退回任务"
)
@PostMapping
(
value
=
"/back"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
allotBack
(
@RequestBody
AllotBackBillSaveVo
allotBackBillSaveVo
)
{
//获取当前配发退回task
TaskBto
taskBto
=
taskService
.
get
(
allotBackBillSaveVo
.
getTaskId
());
...
...
@@ -138,6 +140,7 @@ public class AllotBackBillController {
@ApiOperation
(
value
=
"配发退回接收"
,
notes
=
"可以通过这个接口配发退回接收"
)
@PostMapping
(
value
=
"/back/receive"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
allotBackReceive
(
@RequestBody
AllotBackReceiveVo
allotBackReceiveVo
)
{
//获取当前任务和账单
TaskBto
taskBto
=
taskService
.
get
(
allotBackReceiveVo
.
getTaskId
());
...
...
@@ -189,6 +192,7 @@ public class AllotBackBillController {
@ApiOperation
(
value
=
"配发退回接收审核"
,
notes
=
"可以通过这个接口配发退回接收审核"
)
@PostMapping
(
value
=
"/back/receive/confirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
backReceiveConfirm
(
@RequestBody
AllotReceiveConfirmVo
allotReceiveConfirmVo
)
{
//获取当前的账单和任务
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveConfirmVo
.
getTaskId
());
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/controller/AllotBillController.java
浏览文件 @
e7783a53
...
...
@@ -29,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
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.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -77,6 +78,7 @@ public class AllotBillController {
@ApiOperation
(
value
=
"发起配发业务"
,
notes
=
"可以通过这个接口发起配发任务"
)
@PostMapping
(
value
=
"/addAllotBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addAllotBill
(
@RequestBody
AllotBillSaveVo
allotBillSaveVo
)
{
//1.添加配发单
AllotBill
a
=
allotBillSaveVo
.
toDo
();
...
...
@@ -115,6 +117,7 @@ public class AllotBillController {
@ApiOperation
(
value
=
"配发审核"
,
notes
=
"可以通过这个接口对配发审核"
)
@PostMapping
(
value
=
"/allotConfirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
allotConfirm
(
@RequestBody
AllotBillConfirmVo
allotBillConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
allotBillConfirmVo
.
getTaskId
());
//1.审核通过,改变装备状态,审核任务完成,发起新的配发接收任务
...
...
@@ -179,6 +182,7 @@ public class AllotBillController {
@ApiOperation
(
value
=
"接收配发装备"
,
notes
=
"可以通过这个接口接收配发装备"
)
@PostMapping
(
value
=
"/receiveDevice"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
receiveDevice
(
@RequestBody
AllotReceiveVo
allotReceiveVo
)
{
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveVo
.
getTaskId
());
...
...
@@ -230,6 +234,7 @@ public class AllotBillController {
@ApiOperation
(
value
=
"接收配发装备审核"
,
notes
=
"可以通过这个接口对接收配发装备审核"
)
@PostMapping
(
value
=
"/receiveConfirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
receiveConfirm
(
@RequestBody
AllotReceiveConfirmVo
allotReceiveConfirmVo
)
{
//获取任务和账单
TaskBto
taskBto
=
taskService
.
get
(
allotReceiveConfirmVo
.
getTaskId
());
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/service/impl/AllotBackBillServiceImpl.java
浏览文件 @
e7783a53
...
...
@@ -7,6 +7,7 @@ import com.tykj.dev.misc.exception.ApiException;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Optional
;
...
...
dev-allot/src/main/java/com/tykj/dev/device/allot/service/impl/AllotBillServiceImpl.java
浏览文件 @
e7783a53
...
...
@@ -13,6 +13,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
...
...
@@ -31,9 +32,6 @@ public class AllotBillServiceImpl implements AllotBillService {
@Autowired
private
UserPublicService
userPublicService
;
@Autowired
private
UserUtils
userUtils
;
@Override
public
AllotBill
addEntity
(
AllotBill
allotBillEntity
)
{
return
allotBillDao
.
save
(
allotBillEntity
);
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/controller/DeviceApplyController.java
浏览文件 @
e7783a53
...
...
@@ -37,6 +37,7 @@ import lombok.extern.slf4j.Slf4j;
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.*
;
...
...
@@ -87,6 +88,7 @@ public class DeviceApplyController {
@ApiOperation
(
value
=
"发起装备申请"
,
notes
=
"可以通过这个接口发起装备申请"
)
@PostMapping
(
"/addDeviceApplyBill"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addDeviceApplyBill
(
@RequestBody
DeviceApplySaveVo
deviceApplySaveVo
)
{
//添加申请单
DeviceApplyBill
deviceApplyBillEntity
=
deviceApplyBillService
.
addEntity
(
deviceApplySaveVo
.
toDo
());
...
...
@@ -108,12 +110,14 @@ public class DeviceApplyController {
taskBto
=
new
TaskBto
(
StatusEnum
.
DEVICE_APPLY_CONFIRM
.
id
,
"申请业务"
,
null
,
"."
,
deviceApplyBillEntity
.
getId
(),
9
,
userPublicService
.
findUnitIdByName
(
deviceApplySaveVo
.
getReplyUnit
()),
1
,
null
,
userIds
);
}
taskService
.
start
(
taskBto
);
log
.
info
(
"[申请模块]:发起装备申请"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
deviceApplyBillEntity
);
}
@ApiOperation
(
value
=
"装备申请批复"
,
notes
=
"可以通过这个接口批复"
)
@PostMapping
(
"/replay"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addDeviceApplyBillReplay
(
@RequestBody
DeviceApplyConfirmVo
deviceApplyConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
deviceApplyConfirmVo
.
getTaskId
());
Integer
userId
=
userUtils
.
getCurrentUserId
();
...
...
@@ -127,6 +131,7 @@ public class DeviceApplyController {
applyBillEntity
.
setApplyStatus
(
1
);
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
deviceApplyBillService
.
update
(
applyBillEntity
);
log
.
info
(
"[申请模块]:装备申请驳回"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
taskBto
);
}
...
...
@@ -134,6 +139,7 @@ public class DeviceApplyController {
if
(
deviceApplyConfirmVo
.
getStatus
()
==
0
)
{
applyBillEntity
.
setApplyStatus
(
2
);
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
log
.
info
(
"[申请模块]:装备申请批复成功,发起配发子业务"
);
//生成配发子任务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
userId
);
...
...
@@ -149,6 +155,7 @@ public class DeviceApplyController {
@ApiOperation
(
value
=
"装备申请后发起配发"
,
notes
=
"可以通过这个接口装备申请后发起配发"
)
@PostMapping
(
"/allot"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
allot
(
@RequestBody
DeviceApplyAllotSaveVo
deviceApplyAllotSaveVo
)
{
//获取配发的业务
TaskBto
taskBto
=
taskService
.
get
(
deviceApplyAllotSaveVo
.
getTaskId
());
...
...
@@ -193,6 +200,7 @@ public class DeviceApplyController {
}
}
}
log
.
info
(
"[申请模块]:装备申请后发起配发"
);
myWebSocket
.
sendMessage1
();
return
ResponseEntity
.
ok
(
"发起配发成功"
);
}
...
...
dev-apply/src/main/java/com/tykj/dev/device/apply/service/impl/DeviceApplyBillServiceImpl.java
浏览文件 @
e7783a53
...
...
@@ -5,6 +5,7 @@ import com.tykj.dev.device.apply.service.DeviceApplyBillService;
import
com.tykj.dev.device.apply.subject.domin.DeviceApplyBill
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Optional
;
...
...
dev-config/src/main/java/com/tykj/dev/config/service/impl/SystemVariableServiceImpl.java
浏览文件 @
e7783a53
...
...
@@ -5,6 +5,7 @@ import com.tykj.dev.config.repository.SystemVariableDao;
import
com.tykj.dev.config.service.SystemVariableService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* @author dengdiyi
...
...
dev-destroy/src/main/java/com/tykj/dev/device/destroy/controller/DeviceDestroyController.java
浏览文件 @
e7783a53
...
...
@@ -29,10 +29,10 @@ import org.apache.commons.lang3.StringUtils;
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.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.transaction.Transactional
;
import
javax.validation.constraints.NotNull
;
import
java.text.ParseException
;
import
java.util.*
;
...
...
@@ -78,7 +78,7 @@ public class DeviceDestroyController {
@ApiOperation
(
value
=
"提交销毁表单"
,
notes
=
"可以通过这个接口提交销毁表单发起销毁流程"
)
@PostMapping
(
value
=
"/form"
)
@Transactional
(
rollback
On
=
Exception
.
class
)
@Transactional
(
rollback
For
=
Exception
.
class
)
public
ResponseEntity
selectRepairBill
(
@Validated
@RequestBody
DeviceDestroyFormVo
formVo
)
{
//生成销毁账单
User
currentUserInfo
=
AuthenticationUtils
.
getAuthentication
().
getCurrentUserInfo
();
...
...
@@ -95,9 +95,6 @@ public class DeviceDestroyController {
});
//生成销毁审核任务
TaskBto
task
=
taskService
.
start
(
initTaskBto
(
deviceDestroyBillEntitySaved
));
//生成任务日志
// taskLogService.addLog(new TaskLogBto(task.getId(),"发起销毁",billList));
// taskLogService.addLog(new TaskLogBto(task.getId(),"销毁待审核",billList));
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"销毁-出库申请成功"
);
}
...
...
@@ -158,7 +155,7 @@ public class DeviceDestroyController {
@ApiOperation
(
value
=
"销毁出库单确认"
,
notes
=
"可以通过这个确认销毁单"
)
@PutMapping
(
value
=
"/confirmation"
)
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
confirmDestroy
(
@RequestBody
@Validated
DeviceDestroyConfirmVo
deviceDestoryConfirmVo
)
throws
ParseException
{
//初始化需要的数据
TaskBto
task
=
taskService
.
get
(
deviceDestoryConfirmVo
.
getTaskId
());
...
...
@@ -183,21 +180,15 @@ public class DeviceDestroyController {
//将任务推进至下一步
taskService
.
moveToNext
(
task
,
deviceDestroyBill
.
getStartUserBId
());
}
//生成日志所需的文件列表
// ArrayList<FileVo> billList = ListUtil.createList(
// deviceDestroyBill.getDestroyFileName()!=null&&deviceDestroyBill.getDestroyFileUrl()!=null?
// new FileVo("销毁单据", deviceDestroyBill.getDestroyFileName(), deviceDestroyBill.getDestroyFileUrl()):null
// );
//更改对应装备的状态为销毁
handleDeviceDetail
(
deviceDestroyBill
,
null
,
deviceDestoryConfirmVo
.
getResult
());
// //生成任务日志
// taskLogService.addLog(new TaskLogBto(task.getId(),deviceDestoryConfirmVo.getResult() == 0?"销毁成功":"销毁审核失败",billList));
myWebSocket
.
sendMessage1
();
return
selectDestroyDetail
(
deviceDestroyBill
.
getId
());
}
@ApiOperation
(
value
=
"上传销毁单"
,
notes
=
"可以通过这个上传销毁单"
)
@PostMapping
(
value
=
"/upload"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
uploadDestroyFile
(
@RequestBody
UploadDestroyFileVo
uploadDestroyFileVo
)
{
//获取当前task
TaskBto
taskBto
=
taskService
.
get
(
uploadDestroyFileVo
.
getTaskId
());
...
...
dev-library/src/main/java/com/tykj/dev/device/library/controller/DeviceLibraryController.java
浏览文件 @
e7783a53
...
...
@@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
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
java.util.ArrayList
;
...
...
@@ -162,6 +163,7 @@ public class DeviceLibraryController {
@ApiOperation
(
value
=
"更新装备库"
,
notes
=
"可以通过这个接口更新装备库"
)
@PostMapping
(
"/updateDeviceLibrary"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
updateDeviceLibrary
(
@RequestBody
DeviceEditVo
deviceEditVo
)
{
DeviceLibrary
deviceLibraryEntity
=
deviceLibraryService
.
getOne
(
deviceEditVo
.
getDeviceId
());
//更新装备信息
...
...
dev-matching/src/main/java/com/tykj/dev/device/matching/controller/MatchingDeviceController.java
浏览文件 @
e7783a53
...
...
@@ -28,6 +28,7 @@ import io.swagger.annotations.ApiOperation;
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
java.util.ArrayList
;
...
...
@@ -73,6 +74,7 @@ public class MatchingDeviceController {
@ApiOperation
(
value
=
"添加配套设备"
,
notes
=
"可以通过这个接口添加配套设备"
)
@PostMapping
(
value
=
"/add"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addStorageBill
(
@RequestBody
MatchingDeviceBillSaveVo
matchingDeviceBillSaveVo
)
{
//添加账单
MatchingDeviceBill
matchingDeviceBillEntity
=
matchingDeviceBillSaveVo
.
toDo
();
...
...
@@ -85,12 +87,10 @@ public class MatchingDeviceController {
userIds
.
add
(
userId
);
userIds
.
add
(
matchingDeviceBillSaveVo
.
getUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
ADD_MATCHING_DEVICE_CONFIRM
.
id
,
"新增配套"
,
null
,
"."
,
m
.
getId
(),
19
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
TaskBto
taskEntity1
=
taskService
.
start
(
taskBto
);
//
添加业务日志
taskService
.
start
(
taskBto
);
//
日志文件
List
<
FileVo
>
fileVoList
=
new
ArrayList
<>();
fileVoList
.
add
(
new
FileVo
(
"新增确认单"
,
matchingDeviceBillEntity
.
getFileName
(),
matchingDeviceBillEntity
.
getFileUrl
()));
// TaskLogBto taskLogBto = new TaskLogBto(taskEntity1.getId(),"发起新增配套",fileVoList);
// taskLogService.addLog(taskLogBto);
for
(
MatchingDeviceSaveVo
matchingDeviceSaveVo
:
matchingDeviceBillSaveVo
.
getMatchingDeviceSaveVoList
())
{
MatchingDeviceLibrary
matchingDeviceLibraryEntity
=
matchingDeviceSaveVo
.
toDo
();
MatchingDeviceLibrary
saveEntity
=
matchingDeviceLibraryService
.
addEntity
(
matchingDeviceLibraryEntity
);
...
...
@@ -109,14 +109,12 @@ public class MatchingDeviceController {
@ApiOperation
(
value
=
"添加配套设备审核"
,
notes
=
"可以通过这个接口添加配套设备审核"
)
@PostMapping
(
value
=
"/confirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
confirm
(
@RequestBody
MatchingDeviceBillConfirmVo
matchingDeviceBillConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
matchingDeviceBillConfirmVo
.
getTaskId
());
//1.审核成功,入库任务结束,改变装备状态
if
(
matchingDeviceBillConfirmVo
.
getStatus
()
==
0
)
{
taskService
.
update
(
taskService
.
moveToEnd
(
taskBto
));
//添加日业务志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(), "添加配套设备审核成功", null);
// taskLogService.addLog(taskLogBto);
//更新账单状态
MatchingDeviceBill
matchingDeviceBillEntity
=
matchingDeviceBillService
.
getOne
(
taskBto
.
getBillId
());
matchingDeviceBillEntity
.
setBillStatus
(
2
);
...
...
@@ -138,9 +136,6 @@ public class MatchingDeviceController {
//2.审核失败
if
(
matchingDeviceBillConfirmVo
.
getStatus
()
==
1
)
{
taskService
.
update
(
taskService
.
moveToArchive
(
taskBto
));
//添加日业务志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"添加配套设备审核失败",null);
// taskLogService.addLog(taskLogBto);
//更新账单状态
MatchingDeviceBill
matchingDeviceBillEntity
=
matchingDeviceBillService
.
getOne
(
taskBto
.
getBillId
());
matchingDeviceBillEntity
.
setBillStatus
(
1
);
...
...
@@ -201,6 +196,7 @@ public class MatchingDeviceController {
@ApiOperation
(
value
=
"更新配套设备"
,
notes
=
"可以通过这个接口更新配套设备"
)
@PostMapping
(
"/update"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
update
(
@RequestBody
MatchingDeviceEditVo
matchingDeviceEditVo
)
{
MatchingDeviceLibrary
m
=
matchingDeviceLibraryService
.
getOne
(
matchingDeviceEditVo
.
getMatchingDeviceId
());
if
(
matchingDeviceEditVo
.
getCreateUnit
()
!=
null
&&
!
m
.
getCreateUnit
().
equals
(
matchingDeviceEditVo
.
getCreateUnit
()))
{
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingController.java
浏览文件 @
e7783a53
...
...
@@ -15,6 +15,7 @@ import com.tykj.dev.device.user.subject.service.UserPublicService;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.StatusEnum
;
import
com.tykj.dev.misc.exception.ApiException
;
import
com.tykj.dev.misc.utils.ResultUtil
;
import
com.tykj.dev.socket.MyWebSocket
;
import
io.swagger.annotations.Api
;
...
...
@@ -22,6 +23,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
;
...
...
@@ -53,6 +55,7 @@ public class PackingController {
@ApiOperation
(
value
=
"新增列装"
,
notes
=
"可以通过这个接口发起列装"
)
@PostMapping
(
"/addPackingLibrary"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
addPackingLibrary
(
@RequestBody
PackingLibrarySaveVo
packingLibrarySaveVo
)
{
//添加列装装备信息
PackingLibrary
p
=
packingLibrarySaveVo
.
toDo
();
...
...
@@ -75,15 +78,13 @@ public class PackingController {
userIds
.
add
(
packingLibrarySaveVo
.
getUserbId
());
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
PACKING_CONFIRM
.
id
,
"列装业务"
,
null
,
"."
,
packingLibraryEntity
.
getId
(),
1
,
userUtils
.
getCurrentUnitId
(),
1
,
null
,
userIds
);
TaskBto
saveEntity
=
taskService
.
start
(
taskBto
);
//添加业务日志
// TaskLogBto taskLogBto = new TaskLogBto(saveEntity.getId(),"发起列装",null);
// taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
saveEntity
);
}
@ApiOperation
(
value
=
"列装审核"
,
notes
=
"可以通过这个接口进行列装审核"
)
@PostMapping
(
"/confirmPackingLibrary"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
confirmPackingLibrary
(
@RequestBody
PackingLibraryConfirmVo
packingLibraryConfirmVo
)
{
TaskBto
taskBto
=
taskService
.
get
(
packingLibraryConfirmVo
.
getTaskId
());
//审核通过
...
...
@@ -98,9 +99,6 @@ public class PackingController {
packingLibraryService
.
update
(
p
);
}
packingLibraryService
.
update
(
packingLibraryEntity
);
//添加业务日志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"列装审核成功",null);
// taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"审核通过列装成功"
);
}
...
...
@@ -116,9 +114,6 @@ public class PackingController {
packingLibraryService
.
update
(
p
);
}
packingLibraryService
.
update
(
packingLibraryEntity
);
//添加业务日志
// TaskLogBto taskLogBto = new TaskLogBto(taskBto.getId(),"列装审核失败",null);
// taskLogService.addLog(taskLogBto);
myWebSocket
.
sendMessage1
();
return
ResultUtil
.
success
(
"列装审核失败"
);
}
else
{
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/controller/PackingLibraryController.java
浏览文件 @
e7783a53
...
...
@@ -14,6 +14,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
java.util.List
;
...
...
@@ -63,6 +64,7 @@ public class PackingLibraryController {
@ApiOperation
(
value
=
"更新列装库"
,
notes
=
"可以通过这个接口更新列装"
)
@PostMapping
(
"/updatePackingLibrary"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
updatePackingLibrary
(
@RequestBody
PackingEditVo
packingEditVo
)
{
//更新列装信息
if
(
packingEditVo
.
getUpdateVoList
()
!=
null
)
{
...
...
dev-packing/src/main/java/com/tykj/dev/device/packing/service/impl/PackingLibraryServiceImpl.java
浏览文件 @
e7783a53
...
...
@@ -15,6 +15,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.jpa.domain.Specification
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.persistence.Transient
;
import
java.lang.reflect.Field
;
...
...
dev-repair/src/main/java/com/tykj/dev/device/repair/controller/RepairController.java
浏览文件 @
e7783a53
...
...
@@ -40,6 +40,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.*
;
...
...
@@ -104,6 +105,7 @@ public class RepairController {
@ApiOperation
(
value
=
"发起维修"
,
notes
=
"可以通过这个接口发起维修"
)
@PostMapping
(
value
=
"/form"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
createRepair
(
@RequestBody
RepairBillSaveVo
repairBillSaveVo
)
{
//添加维修单和送修单
RepairBill
repairBill
=
new
RepairBill
();
...
...
@@ -172,6 +174,7 @@ public class RepairController {
@ApiOperation
(
value
=
"继续向上发起维修"
,
notes
=
"可以通过这个接口继续向上发起维修"
)
@PostMapping
(
value
=
"/continue/form"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
continueCreateRepair
(
@RequestBody
RepairBillSaveVo
deviceRepairBillSaveVo
)
{
ResponseEntity
responseEntity
=
createRepair
(
deviceRepairBillSaveVo
);
ResultObj
resultObj
=
(
ResultObj
)
responseEntity
.
getBody
();
...
...
@@ -185,6 +188,7 @@ public class RepairController {
@ApiOperation
(
value
=
"发起维修审核"
,
notes
=
"可以通过这个接口发起维修审核"
)
@PostMapping
(
value
=
"/sendConfirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
sendConfirm
(
@RequestBody
RepairConfirmVo
deviceRepairConfirmVo
)
{
Integer
level
=
userUtils
.
getCurrentUnitLevel
();
TaskBto
taskBto
=
taskService
.
get
(
deviceRepairConfirmVo
.
getTaskId
());
...
...
@@ -294,6 +298,7 @@ public class RepairController {
@ApiOperation
(
value
=
"接收维修装备"
,
notes
=
"可以通过这个接口接收维修装备"
)
@PostMapping
(
value
=
"/receive"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
receiveDevice
(
@RequestBody
RepairReceiveVo
repairReceiveVo
)
{
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
repairReceiveVo
.
getTaskId
());
...
...
@@ -384,6 +389,7 @@ public class RepairController {
@ApiOperation
(
value
=
"接收维修装备审核"
,
notes
=
"可以通过这个接口对接收维修装备审核"
)
@PostMapping
(
value
=
"/receiveConfirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
receiveConfirm
(
@RequestBody
RepairConfirmVo
repairConfirmVo
)
{
//获取任务
TaskBto
taskBto
=
taskService
.
get
(
repairConfirmVo
.
getTaskId
());
...
...
@@ -505,6 +511,7 @@ public class RepairController {
@ApiOperation
(
value
=
"修好装备出库"
,
notes
=
"可以通过这个接口修好装备出库"
)
@PostMapping
(
value
=
"/back"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
repairBack
(
@RequestBody
RepairBackBillSaveVo
repairBackBillSaveVo
)
{
//获取当前维修业务,维修单
TaskBto
taskBto
=
taskService
.
get
(
repairBackBillSaveVo
.
getTaskId
());
...
...
@@ -564,6 +571,7 @@ public class RepairController {
@ApiOperation
(
value
=
"修好装备出库审核"
,
notes
=
"可以通过这个接口修好装备出库审核"
)
@PostMapping
(
value
=
"/back/confirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
backConfirm
(
@RequestBody
RepairConfirmVo
repairConfirmVo
)
{
//获取业务,账单,相关装备Id
TaskBto
taskBto
=
taskService
.
get
(
repairConfirmVo
.
getTaskId
());
...
...
@@ -631,6 +639,7 @@ public class RepairController {
@ApiOperation
(
value
=
"修好装备送回接收入库"
,
notes
=
"可以通过这个接口修好装备送回接收"
)
@PostMapping
(
value
=
"/back/receive"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
backReceive
(
@RequestBody
RepairReceiveVo
repairReceiveVo
)
{
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
repairReceiveVo
.
getTaskId
());
...
...
@@ -739,6 +748,7 @@ public class RepairController {
@ApiOperation
(
value
=
"修好装备送回接收入库审核"
,
notes
=
"可以通过这个接口修好装备送回接收"
)
@PostMapping
(
value
=
"/back/receive/confirm"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
backReceiveConfirm
(
@RequestBody
RepairConfirmVo
repairConfirmVo
)
{
//获取业务,退回单,装备id
TaskBto
taskBto
=
taskService
.
get
(
repairConfirmVo
.
getTaskId
());
...
...
@@ -818,6 +828,7 @@ public class RepairController {
@ApiOperation
(
value
=
"更改维修装备状态"
,
notes
=
"可以通过这个接口更改维修装备状态"
)
@PostMapping
(
value
=
"/change"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
changeRepairDeviceStatus
(
@RequestBody
RepairStatusChangeVo
repairStatusChangeVo
)
{
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
repairStatusChangeVo
.
getTaskId
());
...
...
@@ -870,6 +881,7 @@ public class RepairController {
@ApiOperation
(
value
=
"维修换新设备"
,
notes
=
"可以通过这个接口维修换新设备"
)
@PostMapping
(
value
=
"/change/new"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
changeNewDevice
(
@RequestBody
ChangeNewDeviceVo
changeNewDeviceVo
)
{
//获取当前任务
TaskBto
taskBto
=
taskService
.
get
(
changeNewDeviceVo
.
getTaskId
());
...
...
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
e7783a53
...
...
@@ -445,58 +445,4 @@ public class SelfCheckController {
list
.
add
(
taskLogService
.
getByTaskId
(
taskBto
.
getId
()));
return
ResultUtil
.
success
(
list
);
}
// private void setCorn(String cron) throws NoSuchMethodException, NoSuchFieldException, IllegalAccessException {
// Scheduled scheduled = SelfCheckSchedulerTask.class.getDeclaredMethod("createSelfCheckTask").getAnnotation(Scheduled.class);
// InvocationHandler h = Proxy.getInvocationHandler(scheduled);
// Field field = h.getClass().getDeclaredField("memberValues");
// field.setAccessible(true);
// Map memberValues = (Map)field.get(h);
// memberValues.put("cron",cron);
// }
//
// /**
// * Callback allowing a {@link TaskScheduler
// * TaskScheduler} and specific {@link Task Task}
// * instances to be registered against the given the {@link ScheduledTaskRegistrar}.
// *
// * @param taskRegistrar the registrar to be configured.
// */
// @Override
// public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
// taskRegistrar.addTriggerTask(() -> {
// // 自查任务
// List<Units> unitsList = unitsDao.findAll();
// unitsList.forEach(units -> {
// //发起待自查任务
// List<Integer> userIds = new ArrayList<>();
// userIds.add(0);
// TaskBto taskBto = new TaskBto(StatusEnum.WAIT_SELF_CHECK.id,"自查业务",null,".",0,4,units.getUnitId(),0,null,userIds);
// taskService.start(taskBto);
// });
// log.info("[自查模块]定时任务执行");
// } ,(triggerContext) -> {
// CronTrigger cronTrigger;
// if (this.tag == 1) {
// log.info("[自查模块]定时任务动态修改corn表达式:" + cron1 +"(月度)");
// cronTrigger = new CronTrigger(cron1);
// }
// else if (this.tag == 2){
// log.info("[自查模块]定时任务动态修改corn表达式:" + cron2 +"(季度)");
// cronTrigger = new CronTrigger(cron2);
// }
// else if (this.tag == 3){
// log.info("[自查模块]定时任务动态修改corn表达式:" + cron3 +"(年度)");
// cronTrigger = new CronTrigger(cron3);
// }
// else if (this.tag == 4){
// log.info("[自查模块]定时任务动态修改corn表达式:" + cron4 +"(每分钟)");
// cronTrigger = new CronTrigger(cron4);
// }
// else {
// throw new ApiException(ResultUtil.failed("tag只能为1,2,3"));
// }
// return cronTrigger.nextExecutionTime(triggerContext);
// });
// }
}
dev-union/src/test/java/com/tykj/dev/repair/RepairControllerTest.java
浏览文件 @
e7783a53
...
...
@@ -34,7 +34,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.
@SuppressWarnings
(
"ALL"
)
@WithMockUser
(
username
=
"shia"
,
password
=
"qwer1234"
,
authorities
=
"市A专管员"
)
@ActiveProfiles
(
"
dev
"
)
@ActiveProfiles
(
"
test
"
)
public
class
RepairControllerTest
extends
BaseTest
{
static
int
repairSendTaskId
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论