Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
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
项目统一框架
amos-boot-biz
Commits
f624ef9c
Commit
f624ef9c
authored
Oct 20, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化枚举相关代码
parent
c66383a1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
50 deletions
+51
-50
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+7
-11
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+37
-31
QualityProblemServiceImpl.java
...odule/ugp/biz/service/impl/QualityProblemServiceImpl.java
+7
-8
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
View file @
f624ef9c
...
...
@@ -7,8 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProBlemProcessEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProblemProcessEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
...
@@ -18,10 +17,8 @@ import com.yeejoin.amos.feign.workflow.Workflow;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.AjaxResult
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.parsing.Problem
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
...
...
@@ -57,7 +54,7 @@ public class ProblemInitiationServiceImpl {
@Autowired
QualityProblemServiceImpl
qualityProblemService
;
private
static
String
SMSCODE
=
"SMS_UGP_000
2
"
;
private
static
String
SMSCODE
=
"SMS_UGP_000
3
"
;
@Value
(
"${params.work.flow.problemDefinitionKey}"
)
private
String
problemDefinitionKey
;
...
...
@@ -97,7 +94,7 @@ public class ProblemInitiationServiceImpl {
projectInitiation
.
setTaskId
(
dataObject
.
getString
(
"id"
));
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
));
if
(
Pro
B
lemProcessEnum
.
重大问题发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(
Pro
b
lemProcessEnum
.
重大问题发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
// sendSms(object);
}
...
...
@@ -129,12 +126,12 @@ public class ProblemInitiationServiceImpl {
}
public
void
sendSms
(
JSONObject
object
){
public
void
sendSms
(
JSONObject
object
,
String
smsCode
){
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
// smsParams.put("smsCode", SMSCODE
);
//
smsParams.put("companyName", object.getString("installationUnit"));
//
smsParams.put("projectName", object.getString("name"));
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"companyName"
,
object
.
getString
(
"installationUnit"
));
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"name"
));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id查找到该部门下的用户List。
QueryWrapper
<
SuperviseRule
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"admin_region_code"
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
...
...
@@ -159,7 +156,6 @@ public class ProblemInitiationServiceImpl {
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
SmsRecordModel
sendSmsMassage
(
String
smsCode
,
String
mobile
,
HashMap
<
String
,
String
>
smsParams
){
SmsRecordModel
smsRecordModel
=
new
SmsRecordModel
();
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
View file @
f624ef9c
...
...
@@ -10,17 +10,16 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.service.impl.WorkflowExcuteServiceImpl
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProjectInitiationEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.SMSEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Util.CommonResponse
;
import
com.yeejoin.amos.boot.module.ugp.api.Util.HttpUtil
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectInitiationDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.InstallNoticeMsg
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectInitiation
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectInitiationMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProjectInitiationService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
...
@@ -78,15 +77,15 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Autowired
OrgUsrServiceImpl
orgUsrServiceImpl
;
@Autowired
RectifyMsgServiceImpl
rectifyMsgServiceImpl
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectInitiationServiceImpl
.
class
);
@Value
(
"${params.work.flow.processDefinitionKey}"
)
private
String
processDefinitionKey
;
private
static
String
SMSCODE
=
"SMS_UGP_0001"
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
start
(
Project
project
)
{
String
instanceId
=
null
;
//启动流程
...
...
@@ -118,7 +117,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
execute
(
String
instanceId
,
Object
objectd
,
String
option
){
JSONObject
object
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
objectd
));
JSONObject
jsonObject
=
workflowFeignService
.
getTask
(
instanceId
);
...
...
@@ -146,29 +144,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
SMSCODE
);
smsParams
.
put
(
"companyName"
,
object
.
getString
(
"installationUnit"
));
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"name"
));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id查找到该部门下的用户List。
QueryWrapper
<
SuperviseRule
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"admin_region_code"
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByDepartmentId
(
Long
.
valueOf
(
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
()),
null
,
null
,
null
).
getResult
();
//遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。
for
(
AgencyUserModel
agencyUserModel
:
agencyUserModelList
)
{
SmsRecordModel
smsRecordModel
=
sendSmsMassage
(
SMSCODE
,
agencyUserModel
.
getMobile
(),
smsParams
);
InstallNoticeMsg
installNoticeMsg
=
new
InstallNoticeMsg
();
if
(
ValidationUtil
.
isEmpty
(
smsRecordModel
))
{
continue
;
}
installNoticeMsg
.
setContent
(
smsRecordModel
.
getSmsContent
());
installNoticeMsg
.
setInstallNoticeId
(
smsRecordModel
.
getSequenceNbr
());
installNoticeMsg
.
setTargetUnitId
(
Long
.
valueOf
(
smsRecordModel
.
getAgencyCode
()));
installNoticeMsg
.
setTargetPersonId
(
Long
.
valueOf
(
agencyUserModel
.
getUserId
()));
installNoticeMsg
.
setSendTime
(
smsRecordModel
.
getSendTime
());
installNoticeMsgService
.
save
(
installNoticeMsg
);
}
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
}
}
if
(
"监检科室分配"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
...
...
@@ -236,4 +212,34 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
project
.
setStatus
(
getFlowTaskName
(
instanceId
));
projectService
.
updateById
(
project
);
}
public
void
sendSms
(
JSONObject
object
,
String
smsCode
){
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"companyName"
,
object
.
getString
(
"installationUnit"
));
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"name"
));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id查找到该部门下的用户List。
QueryWrapper
<
SuperviseRule
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"admin_region_code"
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
String
noticeUnitId
=
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
();
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByDepartmentId
(
Long
.
valueOf
(
noticeUnitId
),
null
,
null
,
null
).
getResult
();
//遍历用户List,拿到用户手机号、userId,来发短信、存短信日志。
for
(
AgencyUserModel
agencyUserModel
:
agencyUserModelList
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapperQueryWrapper
=
new
LambdaQueryWrapper
<>();
wrapperQueryWrapper
.
eq
(
OrgUsr:
:
getAmosOrgCode
,
agencyUserModel
.
getUserId
());
SmsRecordModel
smsRecordModel
=
sendSmsMassage
(
smsCode
,
agencyUserModel
.
getMobile
(),
smsParams
);
RectifyMsg
rectifyMsg
=
new
RectifyMsg
();
if
(
ValidationUtil
.
isEmpty
(
smsRecordModel
))
{
continue
;
}
rectifyMsg
.
setContent
(
smsRecordModel
.
getSmsContent
());
rectifyMsg
.
setProblemId
(
object
.
getLong
(
"sequenceNbr"
));
rectifyMsg
.
setNoticeUnitId
(
Long
.
valueOf
(
noticeUnitId
));
rectifyMsg
.
setMsgReceiver
(
orgUsrServiceImpl
.
getOne
(
wrapperQueryWrapper
).
getSequenceNbr
());
rectifyMsg
.
setSendTime
(
smsRecordModel
.
getSendTime
());
rectifyMsgServiceImpl
.
save
(
rectifyMsg
);
}
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/QualityProblemServiceImpl.java
View file @
f624ef9c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.Pro
B
lemProcessEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.Pro
b
lemProcessEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.ProblemTypeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.QualityProblem
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.QualityProblemMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IQualityProblemService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.QualityProblemDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
...
@@ -69,7 +68,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua
public
String
updateItem
(
QualityProblem
qualityProblem
,
Long
sequenceNbr
){
QualityProblem
quality
=
this
.
getById
(
sequenceNbr
);
if
(
Pro
B
lemProcessEnum
.
确定问题
.
getName
().
equals
(
quality
.
getStatus
()))
{
if
(
Pro
b
lemProcessEnum
.
确定问题
.
getName
().
equals
(
quality
.
getStatus
()))
{
//监检机构确定问题
quality
.
setLevel
(
qualityProblem
.
getLevel
());
quality
.
setReformLimitDate
(
qualityProblem
.
getReformLimitDate
());
...
...
@@ -82,16 +81,16 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"0"
);
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"1"
);
}
}
else
if
(
Pro
B
lemProcessEnum
.
编制处理方案
.
getName
().
equals
(
quality
.
getStatus
()))
{
}
else
if
(
Pro
b
lemProcessEnum
.
编制处理方案
.
getName
().
equals
(
quality
.
getStatus
()))
{
//编制处理方案
quality
.
setSolution
(
qualityProblem
.
getSolution
());
quality
.
setSolutionDesc
(
qualityProblem
.
getSolutionDesc
());
//执行一次
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"1"
);
}
else
if
(
Pro
B
lemProcessEnum
.
审查处理方案
.
getName
().
equals
(
quality
.
getStatus
())){
}
else
if
(
Pro
b
lemProcessEnum
.
审查处理方案
.
getName
().
equals
(
quality
.
getStatus
())){
//执行一次
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"1"
);
}
else
if
(
Pro
B
lemProcessEnum
.
提交整改书
.
getName
().
equals
(
quality
.
getStatus
()))
{
}
else
if
(
Pro
b
lemProcessEnum
.
提交整改书
.
getName
().
equals
(
quality
.
getStatus
()))
{
//上传整改书
quality
.
setReformDoc
(
qualityProblem
.
getReformDoc
());
quality
.
setReformDesc
(
qualityProblem
.
getReformDesc
());
...
...
@@ -105,7 +104,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"0"
);
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"1"
);
}
}
else
if
(
Pro
B
lemProcessEnum
.
问题分类
.
getName
().
equals
(
quality
.
getProblemType
()))
{
}
else
if
(
Pro
b
lemProcessEnum
.
问题分类
.
getName
().
equals
(
quality
.
getProblemType
()))
{
quality
.
setHandingOpinion
(
qualityProblem
.
getHandingOpinion
());
quality
.
setHandingOpinionDesc
(
qualityProblem
.
getHandingOpinionDesc
());
//执行两次
...
...
@@ -115,7 +114,7 @@ public class QualityProblemServiceImpl extends BaseService<QualityProblemDto,Qua
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"1"
);
problemInitiationService
.
execute
(
quality
.
getInstanceId
(),
quality
,
"1"
);
}
}
else
if
(
Pro
B
lemProcessEnum
.
审查整改过程
.
getName
().
equals
(
quality
.
getStatus
()))
{
}
else
if
(
Pro
b
lemProcessEnum
.
审查整改过程
.
getName
().
equals
(
quality
.
getStatus
()))
{
quality
.
setHandingOpinion
(
qualityProblem
.
getHandingOpinion
());
quality
.
setHandingOpinionDesc
(
qualityProblem
.
getHandingOpinionDesc
());
quality
.
setReviewStatus
(
qualityProblem
.
getReviewStatus
());
...
...
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