Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
platform
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
王琮
platform
Commits
a90499a4
Commit
a90499a4
authored
Mar 08, 2023
by
王国存
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务-问卷、问题、选项、上报记录表生成
parent
a92d9153
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
748 additions
and
73 deletions
+748
-73
QuestionEnum.java
src/main/java/com/tiptimes/ctrl/QuestionEnum.java
+158
-0
QuestionnaireCtrl.java
src/main/java/com/tiptimes/ctrl/QuestionnaireCtrl.java
+27
-5
QuestionnaireVo.java
src/main/java/com/tiptimes/ctrl/QuestionnaireVo.java
+61
-0
ScheduledJob.java
src/main/java/com/tiptimes/ctrl/ScheduledJob.java
+35
-0
QuestionnaireDao.java
src/main/java/com/tiptimes/dao/QuestionnaireDao.java
+16
-4
Questionnaire.java
src/main/java/com/tiptimes/model/Questionnaire.java
+11
-1
Record.java
src/main/java/com/tiptimes/model/Record.java
+11
-1
QuestionnaireService.java
src/main/java/com/tiptimes/service/QuestionnaireService.java
+4
-0
QuestionnaireServiceImpl.java
...a/com/tiptimes/service/impl/QuestionnaireServiceImpl.java
+368
-16
Questionnaire.xml
src/main/resources/mapper/Questionnaire.xml
+57
-46
No files found.
src/main/java/com/tiptimes/ctrl/QuestionEnum.java
0 → 100644
View file @
a90499a4
package
com
.
tiptimes
.
ctrl
;
/**
* 问卷表、选线表名称枚举
**/
public
enum
QuestionEnum
{
BASIC_INFORMATION
(
"基本信息"
),
SPACE_NAME
(
"众创空间名称"
),
AFFILIATED_UNIVERSITY
(
"所属高校"
),
PERSON_NAME
(
"填报人姓名"
),
CONTACT_NUMBER
(
"联系电话"
),
MAKER_SPACE
(
"众创空间场地情况"
),
SPACE_INNOVATION
(
"众创空间面积"
),
SPACE_NUMBER
(
"众创空间提供工位数"
),
LEASE_VENUE
(
"是否租赁场地"
),
IS_LEASE_VENUE
(
"是否租赁场地"
),
LIVE_PHOTO
(
"每块场地实景照片"
),
FULL_STATUS
(
"众创空间配备专职工作人员情况"
),
FULL_STATUS_NAME
(
"姓名"
),
FULL_STATUS_OFFICE
(
"所在处室"
),
FULL_STATUS_DEPARTMENT
(
"所在科室"
),
FULL_STATUS_POSITION
(
"职务"
),
FULL_STATUS_PHONE
(
"联系方式"
),
FULL_STATUS_JOB
(
"是否专职"
),
FULL_STATUS_DESCRIPTION
(
"关于众创空间运营情况的相关说明"
),
INCUBATED_ENTERPRISES
(
"入孵企业情况"
),
ENTERPRISES_NAME
(
"企业名称"
),
ENTERPRISES_PROF
(
"是否提交学信网截图或8年以内学历证明"
),
ENTERPRISES_EQUITY
(
"是否提交股权证明"
),
ENTERPRISES_INCUBATION
(
"是否提交入孵协议"
),
ENTERPRISES_NEWLY
(
"是否为本年度新入驻"
),
JOB_CREATION
(
"新增就业情况"
),
JOB_NAME
(
"企业名称"
),
JOB_PERSONNAME
(
"员工姓名"
),
JOB_EVIDENCE
(
"发送社保或三方协议佐证材料"
),
JOB_ADDPOST
(
"是否为本考核期内新增岗位"
),
ENTREPRENEURSHIP_COURSES
(
"开设创新创业课程情况"
),
ENTREPRENEURSHIP_NAME
(
"课程名称"
),
ENTREPRENEURSHIP_TEACHER
(
"任课老师"
),
ENTREPRENEURSHIP_HOURS
(
"学时"
),
ENTREPRENEURSHIP_CREDIT
(
"学分"
),
ENTREPRENEURSHIP_SCREENSHOT
(
"是否发送学校教务系统的排课截图或导出文件"
),
ENTREPRENEURSHIP_COURSEWARE
(
"是否发送课程大纲或授课课件"
),
ENTREPRENEURSHIP_INTRODUCE
(
"是否发送教师介绍"
),
ENTREPRENEURSHIP_VIDEO_DISPLAY
(
"是否有视频展示"
),
ENTREPRENEURSHIP_NETWORK_CONNECTION
(
"视频展示网络连接"
),
ENTREPRENEURSHIP_DEMONSTRATION
(
"有意愿参与联盟组织的高校教育示范课评选"
),
ENTREPRENEURSHIP_MENTOR
(
"签约创业导师情况"
),
MENTOR_TNAME
(
"导师姓名"
),
MENTOR_SEX
(
"性别"
),
MENTOR_EDUCATIONAL
(
"学历"
),
MENTOR_PHONE
(
"联系电话"
),
MENTOR_UNIT
(
"单位"
),
MENTOR_POSITION
(
"职务"
),
MENTOR_PROFESSIONA
(
"职称"
),
MENTOR_SIGNING_DATE
(
"签约日期"
),
MENTOR_SIGNING_DURATION
(
"签约时长"
),
MENTOR_TUTORING_CATEGORY
(
"擅长辅导类别"
),
MENTOR_TUTORING_INDUSTRY
(
"擅长辅导行业"
),
MENTOR_INTERNET_COMPETITION
(
"参评国家“互联网+”大赛"
),
MENTOR_PARTICIPATION_YEAR
(
"参评年份"
),
MENTOR_GUIDE_TRACK
(
"指导赛道"
),
MENTOR_SUPPORTING_MATERIAL
(
"是否发送佐证材料"
),
MENTOR_ENTREPRENEURIAL_MENTOR
(
"教育部入库创业导师"
),
MENTOR_SUPPORTING_MATERIAL_ONE
(
"是否发送佐证材料"
),
ENTREPRENEURSHIP_ACTIVITIES
(
"组织双创活动情况"
),
ACTIVITIES_TIME
(
"时间"
),
ACTIVITIES_THEME
(
"主题"
),
ACTIVITIES_ACTIVITY_TYPE
(
"活动类型"
),
ACTIVITIES_ACTIVITY_NEWS
(
"平台中有活动新闻"
),
ACTIVITIES_ACTIVITY_PHOTOT
(
"新闻中含1张以上活动照片"
),
COMPETITION_SITUATION
(
"参赛情况"
),
SITUATION_NAME
(
"赛事名称"
),
SITUATION_UNIT
(
"主办单位"
),
SITUATION_ENTRY_NAME
(
"列举1个参赛项目名称"
),
INNOVATION_ENTREPRENEURSHIP
(
"本年创新创业工作经费(万元)"
),
INNOVATION_APPROPRIATION
(
"本年创新创业工作经费(万元)"
),
INNOVATION_PROOF_PHOTOGRAPH
(
"由财务部门出具的相关证明照片或PDF"
),
MAKER_INFORMATION
(
"申报成功高校众创空间联盟发布的创新创业研究课题信息"
),
MAKER_SUBJECT_NUMBER
(
"课题编号"
),
MAKER_SUBJECT_NAME
(
"课题名称"
),
MAKER_SUBJECT_PERSON
(
"课题负责人姓名"
),
INCUBATED_ENTERPRISE
(
"在孵企业销售收入或累计合同额情况"
),
INCUBATED_NAME
(
"企业名称"
),
INCUBATED_AMOUNT
(
"合同金额"
),
INCUBATED_MATERIAL
(
"是否发送佐证材料"
),
INCUBATED_FINANCING_NAME
(
"融资企业名称"
),
INCUBATED_FINANCING_AMOUNT
(
"融资金额"
),
INCUBATED_FINANCING_MODE
(
"融资方式"
),
INCUBATED_MATERIAL_ONE
(
"发送佐证材料"
),
WEEK_ACTIVITIES
(
"主办或承办市级及以上级别路演、双创周活动"
),
ACTIVITIES_NAME
(
"活动名称"
),
ACTIVITIES_DEVELOPMENT
(
"活动开展形式"
),
ACTIVITIES_HOST
(
"市级及以上主办单位名称"
),
LISTING_SITUATION
(
"在孵企业在OTC高校板挂牌情况"
),
SITUATION_BATCH
(
"挂牌批次"
),
SITUATION_PROJECT_NAME
(
"项目名称"
),
PROPERTY_RIGHTS
(
"在孵企业新增知识产权(包括专利、软著等)"
),
PROPERTY_NAME
(
"企业名称"
),
PROPERTY_TIME
(
"获得时间"
),
PROPERTY_PROPERTY
(
"获得产权类型"
),
PROPERTY_NYMBER
(
"编号"
),
PROPERTY_SEND
(
"发送佐证材料"
),
AWARD_SITUATION
(
"获得“互联网+”大赛全国赛事奖项情况"
),
AWARD_TRACK
(
"赛道"
),
AWARD_AWARD
(
"获得奖项"
),
AWARD_TEAM
(
"获奖团队"
),
AWARD_PROJECT
(
"获奖项目"
),
AWARD_SEND
(
"发送佐证材料"
),
AWARDS_COMPETITION
(
"获得创客马拉松大赛及市教委组织的其他双创大赛奖项情况"
),
COMPETITION_NAME
(
"赛事名称"
),
COMPETITION_ORGANIZATION
(
"市教委组织赛事"
),
COMPETITION_AWARD
(
"获得奖项"
),
COMPETITION_TEAM
(
"获奖团队"
),
COMPETITION_PROJECT
(
"获奖项目"
),
COMPETITION_SEND
(
"发送佐证材料"
),
TOPSTATUS
(
"入选天津市创业拔尖项目情况"
),
TOPSTATUS_YEAR
(
"入选年份"
),
TOPSTATUS_NAME
(
"项目名称"
),
TOPSTATUS_ITEM
(
"是否结项"
),
TOPSTATUS_EXCELLENT_PROJECT
(
"是否评为结项优秀项目"
),
NATIONAL_RECORD
(
"是否为国家级备案众创空间"
),
BOOLEAN_NATIONAL_RECORD
(
"是否为国家级备案众创空间"
),
NATIONAL_ENTREPRENEURSHIP
(
"是否为国家创业孵化示范基地"
),
BOOLEAN_NATIONAL_ENTREPRENEURSHIP
(
"是否为国家创业孵化示范基地"
)
;
private
final
String
questionCode
;
QuestionEnum
(
String
questionCode
){
this
.
questionCode
=
questionCode
;
}
public
String
getQuestionCode
()
{
return
questionCode
;
}
}
src/main/java/com/tiptimes/ctrl/QuestionnaireCtrl.java
View file @
a90499a4
package
com
.
tiptimes
.
ctrl
;
package
com
.
tiptimes
.
ctrl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.tiptimes.model.*
;
import
com.tiptimes.model.*
;
...
@@ -7,12 +8,10 @@ import com.tiptimes.service.FileService;
...
@@ -7,12 +8,10 @@ import com.tiptimes.service.FileService;
import
com.tiptimes.service.QuestionnaireService
;
import
com.tiptimes.service.QuestionnaireService
;
import
com.tiptimes.util.*
;
import
com.tiptimes.util.*
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang.ObjectUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -30,6 +29,7 @@ import java.util.*;
...
@@ -30,6 +29,7 @@ import java.util.*;
@Controller
@Controller
@RequestMapping
({
"/questionnaire"
})
@RequestMapping
({
"/questionnaire"
})
public
class
QuestionnaireCtrl
{
public
class
QuestionnaireCtrl
{
@Autowired
@Autowired
private
QuestionnaireService
questionnaireService
;
private
QuestionnaireService
questionnaireService
;
...
@@ -38,8 +38,7 @@ public class QuestionnaireCtrl {
...
@@ -38,8 +38,7 @@ public class QuestionnaireCtrl {
private
static
String
fileUrl
=
""
;
private
static
String
fileUrl
=
""
;
public
QuestionnaireCtrl
()
{
public
QuestionnaireCtrl
()
{
}
}
/**
/**
* 数据上报
* 数据上报
...
@@ -58,7 +57,7 @@ public class QuestionnaireCtrl {
...
@@ -58,7 +57,7 @@ public class QuestionnaireCtrl {
if
(
recordId
==
null
)
{
if
(
recordId
==
null
)
{
recordId
=
this
.
questionnaireService
.
insertRecord
(
new
Record
(
questionnaire
.
getId
(),
questionnaire
.
getQuestionnaireName
(),
recordId
=
this
.
questionnaireService
.
insertRecord
(
new
Record
(
questionnaire
.
getId
(),
questionnaire
.
getQuestionnaireName
(),
0
,
questionnaire
.
getWritePeople
(),
questionnaire
.
getPhoneNumber
(),
questionnaire
.
getCreateName
(),
0
,
questionnaire
.
getWritePeople
(),
questionnaire
.
getPhoneNumber
(),
questionnaire
.
getCreateName
(),
new
Date
(),
questionnaire
.
getCreateId
()));
new
Date
(),
questionnaire
.
getCreateId
()
,
questionnaire
.
getQnYear
()
));
}
}
Record
record
=
this
.
questionnaireService
.
selectById
(
recordId
);
Record
record
=
this
.
questionnaireService
.
selectById
(
recordId
);
if
(
record
.
getProcessStatus
()==
1
||
record
.
getProcessStatus
()==
3
)
{
if
(
record
.
getProcessStatus
()==
1
||
record
.
getProcessStatus
()==
3
)
{
...
@@ -448,4 +447,27 @@ public class QuestionnaireCtrl {
...
@@ -448,4 +447,27 @@ public class QuestionnaireCtrl {
map
.
put
(
"msg"
,
"审核出错稍后再试!"
);
map
.
put
(
"msg"
,
"审核出错稍后再试!"
);
return
map
;
return
map
;
}
}
/**
* 实现问卷表、问题表、选项表每年定时生成
* @param
* @return
*/
@RequestMapping
(
value
=
{
"/generateTableTask"
})
@ResponseBody
public
Map
<
String
,
Object
>
generateTableTask
()
{
return
questionnaireService
.
generateTableTask
();
}
/**
* 实现上报记录表每年定时生成
* @param
* @return
*/
@RequestMapping
(
value
=
{
"/generateRecordTask"
})
@ResponseBody
public
Map
<
String
,
Object
>
generateRecordTask
()
{
return
questionnaireService
.
generateRecordTask
();
}
}
}
\ No newline at end of file
src/main/java/com/tiptimes/ctrl/QuestionnaireVo.java
0 → 100644
View file @
a90499a4
package
com
.
tiptimes
.
ctrl
;
import
java.util.Date
;
public
class
QuestionnaireVo
{
// 问卷名称
private
String
questionnaireName
;
// 问卷状态 1:启用(默认值);0:停用'
private
int
status
;
// 创建时间
private
Date
createTime
;
// 创建者
private
String
createBy
;
// 年份
private
int
qnYear
;
public
int
getQnYear
()
{
return
qnYear
;
}
public
void
setQnYear
(
int
qnYear
)
{
this
.
qnYear
=
qnYear
;
}
public
String
getQuestionnaireName
()
{
return
questionnaireName
;
}
public
void
setQuestionnaireName
(
String
questionnaireName
)
{
this
.
questionnaireName
=
questionnaireName
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
String
getCreateBy
()
{
return
createBy
;
}
public
void
setCreateBy
(
String
createBy
)
{
this
.
createBy
=
createBy
;
}
}
src/main/java/com/tiptimes/ctrl/ScheduledJob.java
0 → 100644
View file @
a90499a4
package
com
.
tiptimes
.
ctrl
;
import
com.tiptimes.service.QuestionnaireService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
@EnableScheduling
@Component
public
class
ScheduledJob
{
@Autowired
private
QuestionnaireService
questionnaireService
;
// @Scheduled(cron = "0 0 23 1 1 ?")
@Scheduled
(
cron
=
"0 0 17 * * ?"
)
@Async
public
void
generateTableTask
(){
System
.
out
.
print
(
Thread
.
currentThread
().
getName
()
+
" cron = 0 0 23 1 1 ? --- "
+
new
Date
()
+
"---START-01"
);
questionnaireService
.
generateTableTask
();
System
.
out
.
print
(
Thread
.
currentThread
().
getName
()
+
" cron = 0 0 23 1 1 ? --- "
+
new
Date
()
+
"---End-01"
);
try
{
Thread
.
sleep
(
2000
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
}
src/main/java/com/tiptimes/dao/QuestionnaireDao.java
View file @
a90499a4
package
com
.
tiptimes
.
dao
;
package
com
.
tiptimes
.
dao
;
import
com.tiptimes.model.Answer
;
import
com.tiptimes.ctrl.QuestionnaireVo
;
import
com.tiptimes.model.PerformanceSummary
;
import
com.tiptimes.model.*
;
import
com.tiptimes.model.Record
;
import
com.tiptimes.model.Review
;
import
com.tiptimes.model.exportDTO.*
;
import
com.tiptimes.model.exportDTO.*
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -11,6 +9,20 @@ import java.util.List;
...
@@ -11,6 +9,20 @@ import java.util.List;
public
interface
QuestionnaireDao
{
public
interface
QuestionnaireDao
{
Long
insertQuestionnaire
(
QuestionnaireVo
questionnaireVo
);
Integer
queryQuestionsId
(
@Param
(
"qnYear"
)
Integer
qnYear
);
int
insertQuestions
(
Questions
questions
);
List
<
Questions
>
queryQuestionsList
(
@Param
(
"qnYear"
)
Integer
qnYear
);
int
insertOptions
(
Options
options
);
List
<
Record
>
queryRecordList
(
Record
record
);
Questionnaire
queryQuestionnaireList
(
@Param
(
"qnYear"
)
Integer
qnYear
);
Long
selectRecordId
(
@Param
(
"questionnaireUuid"
)
Long
questionnaireUuid
,
Long
selectRecordId
(
@Param
(
"questionnaireUuid"
)
Long
questionnaireUuid
,
@Param
(
"createId"
)
String
createId
);
@Param
(
"createId"
)
String
createId
);
...
...
src/main/java/com/tiptimes/model/Questionnaire.java
View file @
a90499a4
...
@@ -14,6 +14,7 @@ public class Questionnaire {//问卷相关数据返回Vo
...
@@ -14,6 +14,7 @@ public class Questionnaire {//问卷相关数据返回Vo
private
String
phoneNumber
;
//联系方式
private
String
phoneNumber
;
//联系方式
private
Integer
type
;
//0暂存 1上报
private
Integer
type
;
//0暂存 1上报
private
String
writePeople
;
//填报人
private
String
writePeople
;
//填报人
private
Integer
qnYear
;
//上报年份
private
List
<
Review
>
reviewList
;
//审核备注
private
List
<
Review
>
reviewList
;
//审核备注
public
String
getWritePeople
()
{
public
String
getWritePeople
()
{
...
@@ -112,12 +113,21 @@ public class Questionnaire {//问卷相关数据返回Vo
...
@@ -112,12 +113,21 @@ public class Questionnaire {//问卷相关数据返回Vo
this
.
phoneNumber
=
phoneNumber
;
this
.
phoneNumber
=
phoneNumber
;
}
}
public
Questionnaire
(
Long
id
,
String
questionnaireName
,
int
status
,
String
createBy
,
Date
createTime
)
{
public
Integer
getQnYear
()
{
return
qnYear
;
}
public
void
setQnYear
(
Integer
qnYear
)
{
this
.
qnYear
=
qnYear
;
}
public
Questionnaire
(
Long
id
,
String
questionnaireName
,
int
status
,
String
createBy
,
Date
createTime
,
Integer
qnYear
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
questionnaireName
=
questionnaireName
;
this
.
questionnaireName
=
questionnaireName
;
this
.
status
=
status
;
this
.
status
=
status
;
this
.
createBy
=
createBy
;
this
.
createBy
=
createBy
;
this
.
createTime
=
createTime
;
this
.
createTime
=
createTime
;
this
.
qnYear
=
qnYear
;
}
}
public
Questionnaire
()
{
public
Questionnaire
()
{
...
...
src/main/java/com/tiptimes/model/Record.java
View file @
a90499a4
...
@@ -14,9 +14,18 @@ public class Record {//上报记录表
...
@@ -14,9 +14,18 @@ public class Record {//上报记录表
private
String
createId
;
//上报人员唯一标识
private
String
createId
;
//上报人员唯一标识
private
List
<
Review
>
reviews
;
//评审备注
private
List
<
Review
>
reviews
;
//评审备注
private
String
writePeople
;
//填报人
private
String
writePeople
;
//填报人
private
Integer
qnYear
;
//上报年份
private
Integer
start
;
private
Integer
start
;
private
Integer
length
;
private
Integer
length
;
public
Integer
getQnYear
()
{
return
qnYear
;
}
public
void
setQnYear
(
Integer
qnYear
)
{
this
.
qnYear
=
qnYear
;
}
public
Integer
getStart
()
{
public
Integer
getStart
()
{
return
start
;
return
start
;
}
}
...
@@ -125,7 +134,7 @@ public class Record {//上报记录表
...
@@ -125,7 +134,7 @@ public class Record {//上报记录表
}
}
public
Record
(
Long
questionnaireUuid
,
String
questionnaireName
,
Integer
processStatus
,
String
phoneNumber
,
public
Record
(
Long
questionnaireUuid
,
String
questionnaireName
,
Integer
processStatus
,
String
phoneNumber
,
String
createBy
,
String
writePeople
,
Date
createTime
,
String
createId
)
{
String
createBy
,
String
writePeople
,
Date
createTime
,
String
createId
,
Integer
qnYear
)
{
this
.
questionnaireUuid
=
questionnaireUuid
;
this
.
questionnaireUuid
=
questionnaireUuid
;
this
.
questionnaireName
=
questionnaireName
;
this
.
questionnaireName
=
questionnaireName
;
this
.
processStatus
=
processStatus
;
this
.
processStatus
=
processStatus
;
...
@@ -134,5 +143,6 @@ public class Record {//上报记录表
...
@@ -134,5 +143,6 @@ public class Record {//上报记录表
this
.
createBy
=
createBy
;
this
.
createBy
=
createBy
;
this
.
createTime
=
createTime
;
this
.
createTime
=
createTime
;
this
.
createId
=
createId
;
this
.
createId
=
createId
;
this
.
qnYear
=
qnYear
;
}
}
}
}
src/main/java/com/tiptimes/service/QuestionnaireService.java
View file @
a90499a4
...
@@ -115,6 +115,10 @@ public interface QuestionnaireService {
...
@@ -115,6 +115,10 @@ public interface QuestionnaireService {
Integer
saveReview
(
List
<
Review
>
reviews
)
throws
Exception
;
Integer
saveReview
(
List
<
Review
>
reviews
)
throws
Exception
;
Map
<
String
,
Object
>
modifyRecordStatusByRecordId
(
Long
recordId
);
Map
<
String
,
Object
>
modifyRecordStatusByRecordId
(
Long
recordId
);
Map
<
String
,
Object
>
generateTableTask
();
Map
<
String
,
Object
>
generateRecordTask
();
}
}
src/main/java/com/tiptimes/service/impl/QuestionnaireServiceImpl.java
View file @
a90499a4
This diff is collapsed.
Click to expand it.
src/main/resources/mapper/Questionnaire.xml
View file @
a90499a4
...
@@ -3,29 +3,57 @@
...
@@ -3,29 +3,57 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.tiptimes.dao.QuestionnaireDao"
>
<mapper
namespace=
"com.tiptimes.dao.QuestionnaireDao"
>
<insert
id=
"insertQuestionnaire"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
INSERT INTO t_questionnaire(questionnaire_name,status,create_time,create_by,qn_year)
VALUES(#{questionnaireName},#{status},#{createTime},#{createBy},#{qnYear})
</insert>
<!--根据年份查询问卷的id-->
<select
id=
"queryQuestionsId"
parameterType=
"Integer"
resultType=
"Integer"
>
select id from t_questionnaire where
<if
test=
"qnYear != null and qnYear != ''"
>
qn_year = #{qnYear}
</if>
</select>
<insert
id=
"insertQuestions"
parameterType=
"com.tiptimes.model.Questions"
>
INSERT INTO t_questions(questionnaire_uuid,question,status,create_time)
VALUES(#{questionnaireUuid},#{question},#{status},#{createTime})
</insert>
<!--根据年份查询问题集合-->
<select
id=
"queryQuestionsList"
parameterType=
"Integer"
resultType=
"com.tiptimes.model.Questions"
>
SELECT tq.id,tq.questionnaire_uuid AS questionnaireUuid,tq.question FROM t_questions tq
LEFT JOIN t_questionnaire qn ON qn.id = tq.questionnaire_uuid
WHERE
<if
test=
"qnYear != null and qnYear != ''"
>
qn.qn_year = #{qnYear}
</if>
</select>
<insert
id=
"insertOptions"
parameterType=
"com.tiptimes.model.Options"
>
INSERT INTO t_options(question_id,option_value,status)
VALUES(#{questionId},#{optionValue},#{status})
</insert>
<!--查询商报记录相关数据,用于生成每年的数据使用-->
<select
id=
"queryRecordList"
resultType=
"com.tiptimes.model.Record"
>
SELECT
create_by AS createBy,
write_people AS writePeople,
phone_number AS phoneNumber,
create_id AS createId,
process_status AS processStatus
FROM
t_record
WHERE questionnaire_uuid = 1
</select>
<!--查询商报记录相关数据,用于生成每年的数据使用-->
<select
id=
"queryQuestionnaireList"
parameterType=
"Integer"
resultType=
"com.tiptimes.model.Questionnaire"
>
select id,questionnaire_name as questionnaireName,qn_year as qnYear from t_questionnaire
where
<if
test=
"qnYear != null and qnYear != ''"
>
qn_year = #{qnYear}
</if>
</select>
<insert
id=
"insertRecord"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertRecord"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
INSERT INTO t_record
INSERT INTO t_record(questionnaire_uuid,questionnaire_name,process_status,phone_number,create_time,
(
create_by,create_id,write_people,qn_year)
questionnaire_uuid,
VALUES(#{questionnaireUuid},#{questionnaireName},#{processStatus},#{phoneNumber},#{createTime},
questionnaire_name,
#{createBy},#{createId},#{writePeople},#{qnYear})
process_status,
phone_number,
create_time,
create_by,
create_id,
write_people
)
VALUES
(
#{questionnaireUuid},
#{questionnaireName},
#{processStatus},
#{phoneNumber},
#{createTime},
#{createBy},
#{createId},
#{writePeople}
)
</insert>
</insert>
<insert
id=
"insertAnswer"
parameterType=
"com.tiptimes.model.Answer"
>
<insert
id=
"insertAnswer"
parameterType=
"com.tiptimes.model.Answer"
>
...
@@ -54,34 +82,19 @@
...
@@ -54,34 +82,19 @@
</update>
</update>
<delete
id=
"delAnswer"
>
<delete
id=
"delAnswer"
>
DELETE FROM
DELETE FROM t_answer WHERE record_id=#{recordId}
t_answer
WHERE
record_id=#{recordId}
</delete>
</delete>
<delete
id=
"delView"
>
<delete
id=
"delView"
>
DELETE FROM
DELETE FROM t_review WHERE record_id=#{recordId} and questions_id =#{questionsId}
t_review
WHERE
record_id=#{recordId} and questions_id =#{questionsId}
</delete>
</delete>
<select
id=
"selectRecordId"
resultType=
"java.lang.Long"
>
<select
id=
"selectRecordId"
resultType=
"java.lang.Long"
>
SELECT id FROM t_record
SELECT id FROM t_record WHERE questionnaire_uuid=#{questionnaireUuid} AND create_id = #{createId}
WHERE questionnaire_uuid=#{questionnaireUuid} AND
create_id = #{createId}
</select>
</select>
<select
id=
"selectAnswerByRecordId"
resultType=
"com.tiptimes.model.Answer"
>
<select
id=
"selectAnswerByRecordId"
resultType=
"com.tiptimes.model.Answer"
>
SELECT
SELECT options_id AS 'optionsId',`value`,`group` FROM t_answer WHERE record_id =#{recordId}
options_id AS 'optionsId',
`value`,
`group`
FROM
t_answer
WHERE
record_id =#{recordId}
</select>
</select>
<select
id=
"selectReviewByRecordId"
resultType=
"com.tiptimes.model.Review"
>
<select
id=
"selectReviewByRecordId"
resultType=
"com.tiptimes.model.Review"
>
...
@@ -95,10 +108,8 @@
...
@@ -95,10 +108,8 @@
</select>
</select>
<select
id=
"selectById"
resultType=
"com.tiptimes.model.Record"
>
<select
id=
"selectById"
resultType=
"com.tiptimes.model.Record"
>
SELECT process_status AS 'processStatus',reason,create_by AS 'createBy',
SELECT process_status AS 'processStatus',reason,create_by AS 'createBy',phone_number AS 'phoneNumber'
phone_number AS 'phoneNumber'
FROM t_record WHERE id=#{recordId}
FROM t_record
WHERE id=#{recordId}
</select>
</select>
<select
id=
"selectRecordList"
resultType=
"com.tiptimes.model.Record"
>
<select
id=
"selectRecordList"
resultType=
"com.tiptimes.model.Record"
>
...
@@ -579,7 +590,7 @@
...
@@ -579,7 +590,7 @@
WHERE record_id = #{recordId} and options_id = #{optionsId}
WHERE record_id = #{recordId} and options_id = #{optionsId}
</update>
</update>
<!--查询审批页面各个问题是否都是通过状态,
封信
列表的审批状态使用-->
<!--查询审批页面各个问题是否都是通过状态,
审批
列表的审批状态使用-->
<select
id=
"selectAnswerByStatus"
resultType=
"com.tiptimes.model.Review"
>
<select
id=
"selectAnswerByStatus"
resultType=
"com.tiptimes.model.Review"
>
SELECT
SELECT
DISTINCT approval_status
DISTINCT approval_status
...
...
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