Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dataC_api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高宇
dataC_api
Commits
39e96aa6
Commit
39e96aa6
authored
May 15, 2024
by
高宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.月度信息
parent
5e24225f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
20 deletions
+57
-20
DataApiApplication.java
src/main/java/org/rcisoft/DataApiApplication.java
+2
-0
Jnsp7xtmDqsjController.java
...t/bus/jnsp7xtmdqsj/controller/Jnsp7xtmDqsjController.java
+7
-2
Jnsp7xtmDqsjService.java
...rcisoft/bus/jnsp7xtmdqsj/service/Jnsp7xtmDqsjService.java
+6
-1
Jnsp7xtmDqsjServiceImpl.java
...us/jnsp7xtmdqsj/service/impl/Jnsp7xtmDqsjServiceImpl.java
+29
-6
TaskInfoController.java
...g/rcisoft/bus/taskinfo/controller/TaskInfoController.java
+3
-3
TaskInfo.java
src/main/java/org/rcisoft/bus/taskinfo/entity/TaskInfo.java
+5
-4
TaskInfoMapper.xml
...n/resources/mapper/bus/taskinfo/mapper/TaskInfoMapper.xml
+5
-4
No files found.
src/main/java/org/rcisoft/DataApiApplication.java
View file @
39e96aa6
...
...
@@ -4,6 +4,7 @@ import org.mybatis.spring.annotation.MapperScan;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.EnableAspectJAutoProxy
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
...
...
@@ -15,6 +16,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@EnableScheduling
@EnableGlobalMethodSecurity
(
prePostEnabled
=
true
)
@MapperScan
(
basePackages
=
{
"org.rcisoft.**.dao"
,
"org.activiti.dao"
})
//扫描dao 不需要@repository
@EnableAsync
public
class
DataApiApplication
{
public
static
void
main
(
String
[]
args
)
{
...
...
src/main/java/org/rcisoft/bus/jnsp7xtmdqsj/controller/Jnsp7xtmDqsjController.java
View file @
39e96aa6
...
...
@@ -6,6 +6,7 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.bus.taskinfo.entity.TaskInfo
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.util.CyEpExcelUtil
;
...
...
@@ -151,9 +152,13 @@ public class Jnsp7xtmDqsjController extends CyPaginationController<Jnsp7xtmDqsj>
@ApiOperation
(
value
=
"月度表拉取"
,
notes
=
"月度表拉取"
)
@PostMapping
(
value
=
"/monthlyTablePull"
)
public
CyResult
monthlyTablePull
()
{
return
CyResultGenUtil
.
builder
(
jnsp7xtmDqsjServiceImpl
.
monthlyTablePull
(),
//service1
TaskInfo
taskInfo
=
jnsp7xtmDqsjServiceImpl
.
addTaskInfo
();
//service2
jnsp7xtmDqsjServiceImpl
.
monthlyTablePull
(
taskInfo
.
getTackId
());
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
null
);
taskInfo
);
}
}
src/main/java/org/rcisoft/bus/jnsp7xtmdqsj/service/Jnsp7xtmDqsjService.java
View file @
39e96aa6
...
...
@@ -4,9 +4,11 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.rcisoft.bus.jnsp7xtm.dto.Jnsp7xtmOptionDto
;
import
org.rcisoft.bus.jnsp7xtmdqsj.entity.Jnsp7xtmDqsj
;
import
org.rcisoft.bus.taskinfo.entity.TaskInfo
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.aop.CyPageUtilAsp
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.core.result.enums.CyResSvcExcEnum
;
import
java.util.List
;
...
...
@@ -79,5 +81,8 @@ public interface Jnsp7xtmDqsjService {
/**
* 流程添加
* **/
CyPersistModel
monthlyTablePull
();
CyPersistModel
monthlyTablePull
(
String
takeId
);
// 添加任务
TaskInfo
addTaskInfo
();
}
src/main/java/org/rcisoft/bus/jnsp7xtmdqsj/service/impl/Jnsp7xtmDqsjServiceImpl.java
View file @
39e96aa6
...
...
@@ -21,7 +21,10 @@ import org.rcisoft.bus.jnsp7xtm.dto.Jnsp7xtmOptionDto;
import
org.rcisoft.bus.jnsp7xtm.entity.Jnsp7xtm
;
import
org.rcisoft.bus.jnsp7xtm.enums.ColTransitionEnum
;
import
org.rcisoft.bus.jnsp7xtm.vo.Jnsp7xtmVo
;
import
org.rcisoft.bus.taskinfo.dao.TaskInfoRepository
;
import
org.rcisoft.bus.taskinfo.entity.TaskInfo
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.util.CyIdGenUtil
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.aop.CyPageUtilAsp
;
import
org.rcisoft.core.model.CyPersistModel
;
...
...
@@ -35,16 +38,15 @@ import org.rcisoft.util.ExcelExportStatisticStyler;
import
org.rcisoft.util.ExportToExcelUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.concurrent.CompletableFuture
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.locks.Lock
;
import
java.util.concurrent.locks.ReentrantLock
;
...
...
@@ -66,6 +68,9 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository,
// 月度表拉取锁
private
static
Lock
monthlyTablePullLock
=
new
ReentrantLock
();
@Autowired
private
TaskInfoRepository
taskInfoRepository
;
@Value
(
"${jnsp7xtmDqsj.batchAddPagesize}"
)
private
Integer
batchInsertSize
;
...
...
@@ -188,11 +193,12 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository,
}
/**
* 月度表
重置
* 月度表
拉取
* **/
@Override
@Async
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
public
CyPersistModel
monthlyTablePull
()
{
public
CyPersistModel
monthlyTablePull
(
String
taskId
)
{
try
{
if
(
monthlyTablePullLock
.
tryLock
(
1000
,
TimeUnit
.
MILLISECONDS
))
{
try
{
...
...
@@ -214,6 +220,11 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository,
baseMapper
.
batchAddJnsp7xtmDqsj
(
addList
);
// 停止计时器
stopwatch
.
stop
();
QueryWrapper
<
TaskInfo
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"tack_id"
,
taskId
);
TaskInfo
taskInfo
=
taskInfoRepository
.
selectOne
(
queryWrapper
);
taskInfo
.
setStatus
(
"1"
);
taskInfoRepository
.
updateById
(
taskInfo
);
log
.
info
(
"查询耗时秒"
+
stopwatch
.
elapsed
().
getSeconds
());
log
.
info
(
"查询耗时毫秒"
+
stopwatch
.
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
catch
(
Exception
e
)
{
...
...
@@ -232,4 +243,16 @@ public class Jnsp7xtmDqsjServiceImpl extends ServiceImpl<Jnsp7xtmDqsjRepository,
return
new
CyPersistModel
(
1
);
}
/**添加任务**/
@Override
public
TaskInfo
addTaskInfo
()
{
TaskInfo
taskInfo
=
new
TaskInfo
();
taskInfo
.
setStatus
(
"0"
);
taskInfo
.
setType
(
"jnsp7xtmDqsj"
);
// 生成uuid
taskInfo
.
setTackId
(
CyIdGenUtil
.
uuid
());
taskInfoRepository
.
insert
(
taskInfo
);
return
taskInfo
;
}
}
src/main/java/org/rcisoft/bus/taskinfo/controller/TaskInfoController.java
View file @
39e96aa6
...
...
@@ -56,7 +56,7 @@ public class TaskInfoController extends CyPaginationController<TaskInfo> {
@ApiOperation
(
value
=
"逻辑删除?????"
,
notes
=
"逻辑删除?????"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/deleteLogical/{businessId:\\w+}"
)
public
CyResult
deleteLogical
(
@PathVariable
String
businessId
,
TaskInfo
taskInfo
)
{
public
CyResult
deleteLogical
(
@PathVariable
Integer
businessId
,
TaskInfo
taskInfo
)
{
taskInfo
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
taskInfoServiceImpl
.
removeLogical
(
taskInfo
);
return
CyResultGenUtil
.
builder
(
data
,
...
...
@@ -69,7 +69,7 @@ public class TaskInfoController extends CyPaginationController<TaskInfo> {
@ApiOperation
(
value
=
"删除?????"
,
notes
=
"删除?????"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/delete/{businessId:\\w+}"
)
public
CyResult
delete
(
@PathVariable
String
businessId
,
TaskInfo
taskInfo
)
{
public
CyResult
delete
(
@PathVariable
Integer
businessId
,
TaskInfo
taskInfo
)
{
taskInfo
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
taskInfoServiceImpl
.
remove
(
taskInfo
);
return
CyResultGenUtil
.
builder
(
data
,
...
...
@@ -83,7 +83,7 @@ public class TaskInfoController extends CyPaginationController<TaskInfo> {
@ApiOperation
(
value
=
"修改?????"
,
notes
=
"修改?????"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/update/{businessId:\\w+}"
)
public
CyResult
update
(
@PathVariable
String
businessId
,
@Valid
TaskInfo
taskInfo
,
BindingResult
bindingResult
)
{
public
CyResult
update
(
@PathVariable
Integer
businessId
,
@Valid
TaskInfo
taskInfo
,
BindingResult
bindingResult
)
{
taskInfo
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
taskInfoServiceImpl
.
merge
(
taskInfo
);
return
CyResultGenUtil
.
builder
(
data
,
...
...
src/main/java/org/rcisoft/bus/taskinfo/entity/TaskInfo.java
View file @
39e96aa6
...
...
@@ -11,20 +11,21 @@ import java.io.Serializable;
import
java.util.Date
;
import
java.util.List
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
/**
* Created with cy on 2024年5月15日 下午6:59:06.
*/
@Data
@TableName
(
"task_info"
)
public
class
TaskInfo
extends
CyIdEntity
<
TaskInfo
>
{
public
class
TaskInfo
extends
CyId
Incre
Entity
<
TaskInfo
>
{
/**
* @desc ??id
* @column tack_id
* @default
* @default
*/
@Excel
(
name
=
"??id"
,
orderNum
=
"0"
,
width
=
20
)
private
String
tackId
;
...
...
@@ -32,7 +33,7 @@ public class TaskInfo extends CyIdEntity<TaskInfo> {
/**
* @desc ?? 0:??? 1:???
* @column status
* @default
* @default
*/
@Excel
(
name
=
"?? 0:??? 1:???"
,
orderNum
=
"1"
,
width
=
20
)
private
String
status
;
...
...
@@ -40,7 +41,7 @@ public class TaskInfo extends CyIdEntity<TaskInfo> {
/**
* @desc ??
* @column type
* @default
* @default
*/
@Excel
(
name
=
"??"
,
orderNum
=
"2"
,
width
=
20
)
private
String
type
;
...
...
src/main/resources/mapper/bus/taskinfo/mapper/TaskInfoMapper.xml
View file @
39e96aa6
...
...
@@ -4,8 +4,8 @@
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.bus.taskinfo.entity.TaskInfo"
>
<id
column=
"business_id"
jdbcType=
"BIGINT"
property=
"businessId"
/>
<result
column=
"flag"
jdbcType=
"
N
CHAR"
property=
"flag"
/>
<result
column=
"del_flag"
jdbcType=
"
N
CHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"
VAR
CHAR"
property=
"flag"
/>
<result
column=
"del_flag"
jdbcType=
"
VAR
CHAR"
property=
"delFlag"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_date"
jdbcType=
"DATE"
property=
"createDate"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
...
...
@@ -14,6 +14,7 @@
<result
column=
"tack_id"
jdbcType=
"VARCHAR"
property=
"tackId"
/>
<result
column=
"status"
jdbcType=
"VARCHAR"
property=
"status"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
<result
column=
"type"
jdbcType=
"VARCHAR"
property=
"type"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
...
...
@@ -25,7 +26,7 @@
and flag = #{entity.flag}
</if>
<if
test=
"entity.tackId !=null and entity.tackId != '' "
>
and tack_id
like concat('%',#{entity.tackId},'%')
and tack_id
= #{entity.tackId}
</if>
<if
test=
"entity.status !=null and entity.status != '' "
>
and status like concat('%',#{entity.status},'%')
...
...
@@ -54,4 +55,4 @@
</if>
ORDER BY business_id DESC
</select>
</mapper>
\ No newline at end of file
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment