Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
device-back
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
1
议题
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Matrix
device-back
Commits
f6f27e46
提交
f6f27e46
authored
7月 30, 2021
作者:
133
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[自查任务] 代码t提交
上级
77529b0b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
76 行增加
和
0 行删除
+76
-0
SelfCheckController.java
.../dev/device/selfcheck/controller/SelfCheckController.java
+76
-0
没有找到文件。
dev-selfcheck/src/main/java/com/tykj/dev/device/selfcheck/controller/SelfCheckController.java
浏览文件 @
f6f27e46
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
controller
;
package
com
.
tykj
.
dev
.
device
.
selfcheck
.
controller
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.tykj.dev.config.repository.SystemVariableDao
;
import
com.tykj.dev.config.service.SystemVariableService
;
import
com.tykj.dev.config.service.SystemVariableService
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.config.swagger.AutoDocument
;
import
com.tykj.dev.device.file.service.FilesUtil
;
import
com.tykj.dev.device.file.service.FilesUtil
;
...
@@ -19,6 +20,8 @@ import com.tykj.dev.device.task.service.TaskService;
...
@@ -19,6 +20,8 @@ import com.tykj.dev.device.task.service.TaskService;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.task.subject.bto.TaskBto
;
import
com.tykj.dev.device.user.read.service.MessageService
;
import
com.tykj.dev.device.user.read.service.MessageService
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.read.subject.bto.MessageBto
;
import
com.tykj.dev.device.user.subject.dao.UnitsDao
;
import
com.tykj.dev.device.user.subject.entity.Units
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.subject.service.UserPublicService
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.device.user.util.UserUtils
;
import
com.tykj.dev.misc.base.BusinessEnum
;
import
com.tykj.dev.misc.base.BusinessEnum
;
...
@@ -580,5 +583,78 @@ public class SelfCheckController {
...
@@ -580,5 +583,78 @@ public class SelfCheckController {
return
ResponseEntity
.
ok
(
"不保存"
);
return
ResponseEntity
.
ok
(
"不保存"
);
}
}
}
}
@Autowired
private
UnitsDao
unitsDao
;
@Autowired
private
SystemVariableDao
systemVariableDao
;
@Autowired
private
SelfCheckBillService
selfCheckBillService
;
@ApiOperation
(
value
=
"是否保存自查任务"
,
notes
=
"可以通过这个接口查询是否保存自查任务"
)
@GetMapping
(
value
=
"/isSaveSelfTask"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResponseEntity
toSave
(){
List
<
Units
>
unitsList
=
unitsDao
.
findAll
();
unitsList
.
forEach
(
units
->
{
//添加账单
SelfCheckBill
selfCheckBill
=
new
SelfCheckBill
();
selfCheckBill
.
setCheckStatus
(
3
);
selfCheckBill
.
setCheckUnit
(
units
.
getName
());
StringBuffer
title
=
new
StringBuffer
();
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
int
year
=
calendar
.
get
(
Calendar
.
YEAR
);
int
month
=
calendar
.
get
(
Calendar
.
MONTH
)+
1
;
title
.
append
(
"系统发起定时"
+
units
.
getName
());
title
.
append
(
year
).
append
(
"年"
);
title
.
append
(
month
).
append
(
"月自查任务"
);
int
type
=
1
;
// if (' '==cron.charAt(11)) {
// type = Integer.parseInt(cron.substring(10,11));
// }
// else {
// type = Integer.parseInt(cron.substring(10,12));
// }
if
(
type
==
1
)
{
selfCheckBill
.
setCycle
(
1
);
}
else
if
(
type
==
3
){
selfCheckBill
.
setCycle
(
2
);
}
else
if
(
type
==
12
){
selfCheckBill
.
setCycle
(
3
);
}
else
{
selfCheckBill
.
setCycle
(
type
+
2
);
}
// if (cron.equals(cron1)){
// title.append(month).append("月自查任务");
// selfCheckBill.setCycle(1);
// }
// else if (cron.equals(cron2)){
// title.append(getQuarter(month)).append("自查任务");
// selfCheckBill.setCycle(2);
// }
// else if (cron.equals(cron3)){
// title.append("自查任务");
// selfCheckBill.setCycle(3);
// }
// else {
// title.append("自查任务");
// selfCheckBill.setCycle(0);
// }
selfCheckBill
.
setTitle
(
title
.
toString
());
SelfCheckBill
selfCheckBill1
=
selfCheckBillService
.
addEntity
(
selfCheckBill
);
//发起待自查任务
List
<
Integer
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
0
);
// selfCheckBill.setTitle("系统发起"+units.getName()+"自查任务");
TaskBto
taskBto
=
new
TaskBto
(
StatusEnum
.
WAIT_SELF_CHECK
.
id
,
title
.
toString
(),
null
,
"."
,
selfCheckBill1
.
getId
(),
4
,
units
.
getUnitId
(),
0
,
null
,
userIds
);
taskService
.
start
(
taskBto
);
});
return
ResponseEntity
.
ok
(
"ok"
);
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论