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
cd2ebabf
Commit
cd2ebabf
authored
Oct 18, 2022
by
zhangyingbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化Org方法,新增流程发送短信方法
parent
7a85252e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
108 additions
and
10 deletions
+108
-10
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+4
-2
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+10
-5
OrgServiceImpl.java
...amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
+5
-2
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+84
-0
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+5
-1
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
cd2ebabf
...
...
@@ -185,7 +185,7 @@ public class CompanyController extends BaseController {
if
(
company
.
getApproved
().
equals
(
"已审核"
)){
final
CompanyModel
companyModel
=
new
CompanyModel
();
final
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
//创建平台企业
companyModel
.
setCompanyName
(
company
.
getName
());
...
...
@@ -194,7 +194,7 @@ public class CompanyController extends BaseController {
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"headquarter"
);
companyModel
.
setAgencyCode
(
"ugp"
);
final
CompanyModel
companyModelFeignClient
=
Privilege
.
companyClient
.
create
(
companyModel
).
getResult
();
CompanyModel
companyModelFeignClient
=
Privilege
.
companyClient
.
create
(
companyModel
).
getResult
();
//创建平台用户
String
admin
=
company
.
getAdmin
();
...
...
@@ -220,6 +220,8 @@ public class CompanyController extends BaseController {
jsonObject
=
null
;
jsonObject
.
put
(
"name"
,
admin
);
jsonObject
.
put
(
"phone"
,
adminPhone
);
jsonObject
.
put
(
"amosOrgId"
,
agencyUserModel
.
getSequenceNbr
());
jsonObject
.
put
(
"amosOrgCode"
,
agencyUserModel
.
getUserId
());
orgServiceImpl
.
dataHandling
(
jsonObject
,
OrgEnum
.
企业管理员
.
getKey
(),
null
);
}
return
ResponseHelper
.
buildResponse
(
companyServiceImpl
.
updateById
(
company
));
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
cd2ebabf
...
...
@@ -180,12 +180,17 @@ public class ProjectController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询当前登陆人所在单位下的所以项目列表"
,
notes
=
"查询当前登陆人所在单位下的所以项目列表"
)
@GetMapping
(
value
=
"/getCompanyProjects"
)
public
ResponseModel
<
List
<
Project
>>
getCompanyProjects
(){
Long
companyId
=
orgServiceImpl
.
getCompanyId
();
if
(
ValidationUtil
.
isEmpty
(
companyId
)){
return
ResponseHelper
.
buildResponse
(
new
ArrayList
<>());
}
Long
companyId
=
null
;
//获取当前登陆人所在单位id
// companyId = orgServiceImpl.getCompanyId();
// if(ValidationUtil.isEmpty(companyId)){
// return ResponseHelper.buildResponse(new ArrayList<>());
// }
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Project:
:
getConstructionUnitId
,
companyId
);
if
(!
ValidationUtil
.
isEmpty
(
companyId
))
{
wrapper
.
eq
(
Project:
:
getConstructionUnitId
,
companyId
);
}
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
list
(
wrapper
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
View file @
cd2ebabf
...
...
@@ -121,12 +121,12 @@ public class OrgServiceImpl {
orgUsr
.
setBizOrgName
(
jsonObject
.
getString
(
"name"
));
orgUsr
.
setSequenceNbr
(
jsonObject
.
getLong
(
"sequenceNbr"
));
orgUsr
.
setBizOrgType
(
bizOrgType
);
orgUsr
.
setAmosOrgId
(
jsonObject
.
getString
(
"amosOrgId"
));
orgUsr
.
setAmosOrgCode
(
jsonObject
.
getString
(
"amosOrgCode"
));
if
(
OrgEnum
.
公司
.
getKey
().
equals
(
bizOrgType
)){
orgUsr
.
setOrgExpandAttr1
(
jsonObject
.
getString
(
"type"
));
orgUsr
.
setBizOrgCode
(
jsonObject
.
getString
(
"creditCode"
));
orgUsr
.
setAmosOrgId
(
jsonObject
.
getString
(
"amosOrgId"
));
orgUsr
.
setAmosOrgCode
(
jsonObject
.
getString
(
"amosOrgCode"
));
}
if
(
OrgEnum
.
人员
.
getKey
().
equals
(
bizOrgType
)){
if
(
1
==
jsonObject
.
getInteger
(
"isWelder"
))
{
...
...
@@ -215,6 +215,9 @@ public class OrgServiceImpl {
* @return
*/
public
List
<
OrgUsr
>
getSelectInfo
(
String
type
){
if
(
ValidationUtil
.
isEmpty
(
type
)){
return
orgUsrServiceImpl
.
list
();
}
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getOrgExpandAttr1
,
type
);
return
orgUsrServiceImpl
.
list
(
wrapper
);
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
0 → 100644
View file @
cd2ebabf
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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.entity.InstallNoticeMsg
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.RectifyMsg
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.SuperviseRule
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.SmsRecordModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* @author Dell
*/
@Service
public
class
ProblemInitiationServiceImpl
{
@Autowired
ProjectServiceImpl
projectServiceImpl
;
@Autowired
SuperviseRuleServiceImpl
superviseRuleServiceImpl
;
@Autowired
RectifyMsgServiceImpl
rectifyMsgServiceImpl
;
@Autowired
OrgUsrServiceImpl
orgUsrServiceImpl
;
private
static
String
SMSCODE
=
"SMS_UGP_0002"
;
public
void
sendSms
(
JSONObject
object
){
//设置短信发送的基本参数
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
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
SmsRecordModel
sendSmsMassage
(
String
smsCode
,
String
mobile
,
HashMap
<
String
,
String
>
smsParams
){
SmsRecordModel
smsRecordModel
=
new
SmsRecordModel
();
if
(!
ValidationUtil
.
isEmpty
(
mobile
)){
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"mobile"
,
mobile
);
smsRecordModel
=
Systemctl
.
smsClient
.
sendCommonSms
(
smsParams
).
getResult
();
}
return
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 @
cd2ebabf
...
...
@@ -10,6 +10,7 @@ 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.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.Util.CommonResponse
;
...
...
@@ -74,6 +75,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Autowired
ProjectServiceImpl
projectService
;
@Autowired
OrgUsrServiceImpl
orgUsrServiceImpl
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectInitiationServiceImpl
.
class
);
@Value
(
"${params.work.flow.processDefinitionKey}"
)
...
...
@@ -150,7 +154,7 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
//条件构造器 通过项目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
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
(
),
null
,
null
,
null
).
getResult
();
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
);
...
...
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