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
c05e4d47
Commit
c05e4d47
authored
Oct 25, 2022
by
sxwnfpwx@163.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
0bac851e
a10f27e1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
360 additions
and
121 deletions
+360
-121
NoticeStatusEnum.java
...ejoin/amos/boot/module/ugp/api/Enum/NoticeStatusEnum.java
+2
-2
ProblemProcessEnum.java
...oin/amos/boot/module/ugp/api/Enum/ProblemProcessEnum.java
+2
-1
ProjectInitiationEnum.java
.../amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
+21
-35
SMSEnum.java
...va/com/yeejoin/amos/boot/module/ugp/api/Enum/SMSEnum.java
+2
-1
XJConstant.java
...eejoin/amos/boot/module/ugp/api/constants/XJConstant.java
+6
-0
InstallNoticePageDto.java
...in/amos/boot/module/ugp/api/dto/InstallNoticePageDto.java
+4
-0
ProjectDto.java
.../com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
+17
-0
ProjectMapper.java
...eejoin/amos/boot/module/ugp/api/mapper/ProjectMapper.java
+5
-0
ProjectMapper.xml
...odule-ugp-api/src/main/resources/mapper/ProjectMapper.xml
+8
-0
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+69
-3
OrgServiceImpl.java
...amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
+21
-1
ProblemInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProblemInitiationServiceImpl.java
+89
-26
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+13
-49
ProjectServiceImpl.java
.../boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
+101
-3
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/NoticeStatusEnum.java
View file @
c05e4d47
...
...
@@ -8,8 +8,8 @@ import lombok.Getter;
public
enum
NoticeStatusEnum
{
已提交
(
"已提交"
,
"0"
),
已接收
(
"已接收"
,
"1"
),
已退回
(
"已退回"
,
"
2
"
),
已通过
(
"已通过"
,
"
3
"
);
已退回
(
"已退回"
,
"
0
"
),
已通过
(
"已通过"
,
"
1
"
);
String
name
;
String
statusId
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProblemProcessEnum.java
View file @
c05e4d47
...
...
@@ -19,7 +19,8 @@ public enum ProblemProcessEnum {
超期整改发送短信
(
"超期整改发送短信"
,
"8"
,
"CQZGFSDX"
),
问题分类
(
"问题分类"
,
"9"
,
"WTFL"
),
转人工
(
"转人工"
,
"10"
,
"ZRG"
),
结束
(
"结束"
,
"11"
,
"JS"
);
结束
(
"结束"
,
"11"
,
"JS"
),
重大问题整改完成发送短信
(
"重大问题整改完成发送短信"
,
"12"
,
"ZDWTZGWCFSDX"
);
private
String
Name
;
private
String
key
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
View file @
c05e4d47
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
java.util.HashMap
;
import
java.util.Map
;
@Getter
@AllArgsConstructor
public
enum
ProjectInitiationEnum
{
项目立项
(
"1"
,
"项目立项"
),
平台审核
(
"2"
,
"平台审核"
),
告知申请
(
"3"
,
"告知申请"
),
接受告知
(
"4"
,
"接受告知"
),
审查项目
(
"5"
,
"审查项目"
),
提交资料
(
"6"
,
"提交资料"
),
审批人审批
(
"7"
,
"审批人审批"
),
审核人审核
(
"8"
,
"审核人审核"
),
监检科室分配
(
"9"
,
"监检科室分配"
),
监检员分配
(
"10"
,
"监检员分配"
),
监检员审核
(
"11"
,
"监检员审核"
),
项目关闭
(
"12"
,
"项目关闭"
),
接受审查意见
(
"13"
,
"接受审查意见"
);
项目立项
(
"1"
,
"项目立项"
,
"XMLX"
),
平台审核
(
"2"
,
"平台审核"
,
"PTSH"
),
告知申请
(
"3"
,
"告知申请"
,
"GZSQ"
),
接受告知
(
"4"
,
"接受告知"
,
"JSGZ"
),
审查项目
(
"5"
,
"审查项目"
,
"SCXM"
),
提交资料
(
"6"
,
"提交资料"
,
"TJZL"
),
审批人审批
(
"7"
,
"审批人审批"
,
"SPRSP"
),
审核人审核
(
"8"
,
"审核人审核"
,
"SHRSH"
),
监检科室分配
(
"9"
,
"监检科室分配"
,
"JJKSFP"
),
监检员分配
(
"10"
,
"监检员分配"
,
"JJYFP"
),
监检员审核
(
"11"
,
"监检员审核"
,
"JJYSH"
),
项目关闭
(
"12"
,
"项目关闭"
,
"XMGB"
),
接受审查意见
(
"13"
,
"接受审查意见"
,
"JSSCYJ"
);
private
String
status
;
private
String
name
;
private
String
code
;
public
static
Map
<
String
,
String
>
getNameByStatusMap
=
new
HashMap
<
String
,
String
>();
public
static
Map
<
String
,
String
>
getStatusByNameMap
=
new
HashMap
<
String
,
String
>();
public
static
Map
<
String
,
String
>
getCodeByNameMap
=
new
HashMap
<
String
,
String
>();
static
{
for
(
ProjectInitiationEnum
projectInitiationEnum:
ProjectInitiationEnum
.
values
()){
getNameByStatusMap
.
put
(
projectInitiationEnum
.
status
,
projectInitiationEnum
.
name
);
getStatusByNameMap
.
put
(
projectInitiationEnum
.
name
,
projectInitiationEnum
.
status
);
getCodeByNameMap
.
put
(
projectInitiationEnum
.
name
,
projectInitiationEnum
.
code
);
}
}
ProjectInitiationEnum
(
String
status
,
String
name
)
{
this
.
status
=
status
;
this
.
name
=
name
;
}
public
String
getStatus
()
{
return
status
;
}
public
void
setStatus
(
String
status
)
{
this
.
status
=
status
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/SMSEnum.java
View file @
c05e4d47
...
...
@@ -10,7 +10,8 @@ public enum SMSEnum {
项目立项驳回短信
(
"项目立项驳回短信"
,
"SMS_UGP_0002"
),
质量问题短信
(
"质量问题短信"
,
"SMS_UGP_0003"
),
重大质量问题短信
(
"重大质量问题短信"
,
"SMS_UGP_0004"
),
超期整改短信
(
"超期整改短信"
,
"SMS_UGP_0005"
);
超期整改短信
(
"超期整改短信"
,
"SMS_UGP_0005"
),
重大问题整改完成短信
(
"重大问题整改完成短信"
,
"SMS_UGP_0006"
);
private
String
name
;
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/constants/XJConstant.java
View file @
c05e4d47
...
...
@@ -21,6 +21,12 @@ public class XJConstant {
public
static
final
String
CHECK_TYPE
=
"CHECK_TYPE"
;
public
static
final
String
DEPT_WF_MAP_DIC_CODE
=
"DEPT_WF_MAP"
;
//审核/审批状态
public
static
final
String
PROCESS_PROJECT_STATE
=
"processProjectState"
;
//监管科室
public
static
final
String
INS_DEP
=
"insDep"
;
public
static
final
String
INS_PRESON
=
"insPerson"
;
/**
* 构造方法
*/
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/InstallNoticePageDto.java
View file @
c05e4d47
...
...
@@ -68,4 +68,8 @@ public class InstallNoticePageDto extends BaseDto {
@ApiModelProperty
(
value
=
"告知申请提交日期"
)
private
String
noticeDate
;
private
Boolean
approved
;
public
String
approvedName
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/dto/ProjectDto.java
View file @
c05e4d47
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
dto
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -85,5 +86,21 @@ public class ProjectDto extends BaseDto {
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
/**
* 监检部门
*/
private
String
inspectionUnit
;
/**
* 监察部门
*/
private
String
superviseDept
;
private
JSONArray
subForm
;
private
String
examineProjectState
;
private
String
processProjectState
;
private
String
insDep
;
private
String
insPerson
;
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/mapper/ProjectMapper.java
View file @
c05e4d47
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.Map
;
/**
* 项目信息表 Mapper 接口
*
...
...
@@ -18,4 +21,6 @@ public interface ProjectMapper extends BaseMapper<Project> {
//通过name查询一条数据
ProjectDto
selectOneByName
(
@RequestParam
String
name
);
ProjectDto
getDetail
(
Long
sequenceNbr
);
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/resources/mapper/ProjectMapper.xml
View file @
c05e4d47
...
...
@@ -9,4 +9,12 @@
where name = #{name}
</select>
<select
id=
"getDetail"
resultType=
"com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto"
>
SELECT p.*,ou1.biz_org_name AS inspection_unit,ou2.biz_org_name AS supervise_dept
FROM tz_ugp_project AS p
LEFT JOIN tz_ugp_supervise_rule AS r ON r.admin_region_code = p.install_region_code
LEFT JOIN cb_org_usr AS ou1 ON ou1.sequence_nbr = r.inspection_unit_id
LEFT JOIN cb_org_usr AS ou2 ON ou2.sequence_nbr = r.supervise_dept_id
WHERE p.sequence_nbr = #{sequenceNbr}
</select>
</mapper>
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
c05e4d47
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WelderEquipmentDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.*
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -21,7 +26,6 @@ import java.util.Date;
import
java.util.List
;
import
java.util.Map
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectServiceImpl
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
...
@@ -50,6 +54,11 @@ public class ProjectController extends BaseController {
ProjectInitiationServiceImpl
projectInitiationService
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
@Autowired
EquipmentServiceImpl
equipmentService
;
@Autowired
AttachmentServiceImpl
attachmentServiceImpl
;
/**
* 新增项目信息表
...
...
@@ -199,6 +208,63 @@ public class ProjectController extends BaseController {
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
list
(
wrapper
));
}
/**
* 项目审核
* @param sequenceNbr
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"项目审核"
,
notes
=
"项目审核"
)
@PostMapping
(
value
=
"/processProject"
)
public
ResponseModel
<
String
>
processProject
(
String
sequenceNbr
,
@RequestBody
JSONObject
json
){
String
option
=
json
.
getString
(
XJConstant
.
PROCESS_PROJECT_STATE
);
Project
project
=
projectServiceImpl
.
getById
(
sequenceNbr
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
project
));
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"审核不通过"
);
if
(
"1"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"审核通过"
);
}
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
/**
* 审核员项目审核
* @param sequenceNbr
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"审核员项目审核"
,
notes
=
"审核员项目审核"
)
@PostMapping
(
value
=
"/insProcess"
)
public
ResponseModel
<
String
>
insProcess
(
String
sequenceNbr
,
@RequestBody
JSONObject
json
){
String
option
=
json
.
getString
(
XJConstant
.
PROCESS_PROJECT_STATE
);
Project
project
=
projectServiceImpl
.
getById
(
sequenceNbr
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
project
));
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"符合"
);
if
(
"0"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"不符合且不需要整改"
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
}
else
if
(
"2"
.
equals
(
option
)){
jsonObject
.
put
(
XJConstant
.
PROCESS_PROJECT_STATE
,
"不符合且需要重新提交资料"
);
}
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
jsonObject
,
option
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"添加附件"
,
notes
=
"添加附件"
)
@PostMapping
(
value
=
"/saveOrUpdateFile"
)
public
ResponseModel
<
String
>
saveOrUpdateFile
(
@RequestBody
JSONObject
jsonObject
){
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
saveOrUpdateFile
(
jsonObject
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"通过sequenceNbr查询项目详情"
,
notes
=
"通过sequenceNbr查询项目详情"
)
@GetMapping
(
value
=
"/getDetail"
)
public
ResponseModel
<
ProjectDto
>
getDetail
(
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
getDetail
(
sequenceNbr
));
}
}
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 @
c05e4d47
...
...
@@ -18,8 +18,10 @@ import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnSer
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceServiceImpl
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.biz.framework.BusinessIdentify
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.DepartmentModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -132,13 +134,16 @@ public class OrgServiceImpl {
if
(
OrgEnum
.
人员
.
getKey
().
equals
(
bizOrgType
)){
if
(
1
==
jsonObject
.
getInteger
(
"isWelder"
))
{
orgUsr
.
setOrgExpandAttr1
(
OrgEnum
.
焊工
.
getKey
());
orgUsr
.
setCode
(
getCode
());
}
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
reginParams
.
getCompany
().
getSequenceNbr
()));
orgUsr
.
setParentId
(
String
.
valueOf
(
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
()));
}
if
(
OrgEnum
.
部门
.
getKey
().
equals
(
bizOrgType
))
{
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
OrgUsr
::
getAmosOrgId
,
String
.
valueOf
(
reginParams
.
getCompany
().
getSequenceNbr
()));
orgUsr
.
setParentId
(
String
.
valueOf
(
orgUsrServiceImpl
.
getOne
(
wrapper
).
getSequenceNbr
()));
}
//设置bizOrgCode
if
(
orgUsr
.
getParentId
()
!=
null
)
{
...
...
@@ -154,6 +159,21 @@ public class OrgServiceImpl {
return
orgUsr
;
}
public
String
getCode
(){
int
c
;
LambdaQueryWrapper
<
OrgUsr
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
orderByDesc
(
OrgUsr:
:
getCode
).
eq
(
OrgUsr:
:
getOrgExpandAttr1
,
OrgEnum
.
焊工
.
getKey
());
String
code
=
orgUsrServiceImpl
.
list
(
wrapper
).
iterator
().
next
().
getCode
();
if
(
ValidationUtil
.
isEmpty
(
code
)){
c
=
0001
;
}
else
{
c
=
Integer
.
parseInt
(
code
)+
1
;
}
String
welderCode
=
OrgEnum
.
焊工
.
getKey
()
+
"-"
+
c
;
return
welderCode
;
}
/**
* 用户单位信息redis获取
**/
...
...
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 @
c05e4d47
...
...
@@ -4,13 +4,16 @@ import com.alibaba.fastjson.JSON;
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.biz.common.bo.ReginParams
;
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.SMSEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.*
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.SmsRecordModel
;
import
com.yeejoin.amos.feign.workflow.Workflow
;
...
...
@@ -54,11 +57,15 @@ public class ProblemInitiationServiceImpl {
@Autowired
QualityProblemServiceImpl
qualityProblemService
;
private
static
String
SMSCODE
=
"SMS_UGP_0003"
;
@Value
(
"${params.work.flow.problemDefinitionKey}"
)
private
String
problemDefinitionKey
;
@Value
(
"supervisionRoleId"
)
private
String
supervisionRoleId
;
@Value
(
"installationRoleId"
)
private
String
installationRoleId
;
public
String
start
(
QualityProblem
qualityProblem
)
{
String
instanceId
=
null
;
...
...
@@ -80,6 +87,7 @@ public class ProblemInitiationServiceImpl {
qualityProblem
.
setInstanceId
(
instanceId
);
qualityProblem
.
setStatus
(
projectInitiationService
.
getFlowTaskName
(
instanceId
));
qualityProblemService
.
updateById
(
qualityProblem
);
sendSms
(
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
qualityProblem
)),
SMSEnum
.
质量问题短信
.
getCode
());
return
instanceId
;
}
...
...
@@ -96,7 +104,19 @@ public class ProblemInitiationServiceImpl {
if
(
ProblemProcessEnum
.
重大问题发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
// sendSms(object);
sendSms
(
object
,
SMSEnum
.
重大质量问题短信
.
getCode
());
}
}
if
(
ProblemProcessEnum
.
超期整改发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
sendSms
(
object
,
SMSEnum
.
超期整改短信
.
getCode
());
}
}
if
(
ProblemProcessEnum
.
重大问题整改完成发送短信
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
sendSms
(
object
,
SMSEnum
.
重大质量问题短信
.
getCode
());
}
}
...
...
@@ -126,33 +146,75 @@ public class ProblemInitiationServiceImpl {
}
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
();
public
void
sendSms
(
JSONObject
object
,
String
smsCode
){
Long
sequenceNbr
=
object
.
getLong
(
"sequenceNbr"
);
if
(
SMSEnum
.
项目安装告知申请
.
getCode
().
equals
(
smsCode
)){
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"projectName"
));
smsParams
.
put
(
"problemDesc"
,
object
.
getString
(
"problemDesc"
));
//条件构造器 通过项目id查出来的项目详情信息中的区域代码,在监管区域规则表中拿到详细信息中的监察部门id,在使用监察部门id拿到平台的监察部门id
LambdaQueryWrapper
<
SuperviseRule
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SuperviseRule:
:
getAdminRegionCode
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
String
noticeUnitId
=
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
();
sendMessage
(
sequenceNbr
,
noticeUnitId
,
smsParams
,
smsCode
,
supervisionRoleId
);
}
else
if
(
SMSEnum
.
项目立项驳回短信
.
getCode
().
equals
(
smsCode
))
{
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
smsParams
.
put
(
"smsCode"
,
smsCode
);
smsParams
.
put
(
"projectName"
,
object
.
getString
(
"projectName"
));
smsParams
.
put
(
"reviewInfo"
,
object
.
getString
(
"reviewInfo"
));
//给监察发短信
LambdaQueryWrapper
<
SuperviseRule
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
SuperviseRule:
:
getAdminRegionCode
,
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallRegionCode
());
String
supervisionUnitId
=
orgUsrServiceImpl
.
getById
(
superviseRuleServiceImpl
.
getOne
(
wrapper
).
getSuperviseDeptId
()).
getAmosOrgId
();
sendMessage
(
sequenceNbr
,
supervisionUnitId
,
smsParams
,
smsCode
,
supervisionRoleId
);
//给安装发短信
String
installationUnitId
=
orgUsrServiceImpl
.
getById
(
projectServiceImpl
.
getById
(
object
.
getLong
(
"projectId"
)).
getInstallationUnitId
()).
getAmosOrgId
();
sendMessage
(
sequenceNbr
,
installationUnitId
,
smsParams
,
smsCode
,
installationRoleId
);
}
}
/**
* 发送短信
* @param sequenceNbr 任务id(项目/问题)
* @param noticeUnitId 平台目标企业id
* @param smsParams 短信参数
* @param smsCode 短信模板
* @param roleId 角色id
*/
public
void
sendMessage
(
Long
sequenceNbr
,
String
noticeUnitId
,
HashMap
<
String
,
String
>
smsParams
,
String
smsCode
,
String
roleId
){
//向noticeUnitId的部门发送短信
List
<
AgencyUserModel
>
agencyUserModelList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
roleId
,
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
;
boolean
bool
=
false
;
List
<
CompanyModel
>
companyModelList
=
agencyUserModel
.
getCompanys
();
for
(
CompanyModel
companyModel
:
companyModelList
)
{
bool
=
companyModel
.
getSequenceNbr
().
equals
(
noticeUnitId
);
if
(
bool
){
break
;
}
}
if
(
bool
)
{
LambdaQueryWrapper
<
OrgUsr
>
wrapperQueryWrapper
=
new
LambdaQueryWrapper
<>();
wrapperQueryWrapper
.
eq
(
OrgUsr:
:
getAmosOrgId
,
agencyUserModel
.
getSequenceNbr
());
SmsRecordModel
smsRecordModel
=
sendSmsMassage
(
smsCode
,
agencyUserModel
.
getMobile
(),
smsParams
);
RectifyMsg
rectifyMsg
=
new
RectifyMsg
();
if
(
ValidationUtil
.
isEmpty
(
smsRecordModel
))
{
continue
;
}
rectifyMsg
.
setContent
(
smsRecordModel
.
getSmsContent
());
rectifyMsg
.
setProblemId
(
sequenceNbr
);
rectifyMsg
.
setNoticeUnitId
(
Long
.
valueOf
(
noticeUnitId
));
rectifyMsg
.
setMsgReceiver
(
orgUsrServiceImpl
.
getOne
(
wrapperQueryWrapper
).
getSequenceNbr
());
rectifyMsg
.
setSendTime
(
smsRecordModel
.
getSendTime
());
rectifyMsgServiceImpl
.
save
(
rectifyMsg
);
}
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
);
}
}
...
...
@@ -167,6 +229,7 @@ public class ProblemInitiationServiceImpl {
return
smsRecordModel
;
}
public
void
updateProBlemFlowStatus
(
String
instanceId
){
LambdaQueryWrapper
<
QualityProblem
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
QualityProblem:
:
getInstanceId
,
instanceId
);
...
...
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 @
c05e4d47
...
...
@@ -80,6 +80,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Autowired
RectifyMsgServiceImpl
rectifyMsgServiceImpl
;
@Autowired
ProblemInitiationServiceImpl
problemInitiationService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectInitiationServiceImpl
.
class
);
@Value
(
"${params.work.flow.processDefinitionKey}"
)
...
...
@@ -140,22 +143,23 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
if
(
ProjectInitiationEnum
.
接受审查意见
.
getName
().
equals
(
dataObject
.
getString
(
"name"
))){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目立项驳回短信
.
getCode
());
}
}
if
(
ProjectInitiationEnum
.
告知申请
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目安装告知申请
.
getCode
());
}
}
if
(
"监检科室分配"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
}
if
(
"监检员分配"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(
ProjectInitiationEnum
.
项目关闭
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
problemInitiationService
.
sendSms
(
object
,
SMSEnum
.
项目立项驳回短信
.
getCode
());
}
}
if
(
"监检员审核"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
}
try
{
//组装信息
...
...
@@ -179,18 +183,6 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
}
@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
;
}
/**
* 获取流程当前任务名称
* @param instanceId
...
...
@@ -209,37 +201,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Project:
:
getInstanceId
,
instanceId
);
Project
project
=
projectService
.
getOne
(
wrapper
);
project
.
setStatus
(
getFlowTaskName
(
instanceId
));
project
.
setStatus
(
ProjectInitiationEnum
.
getCodeByNameMap
.
get
(
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/ProjectServiceImpl.java
View file @
c05e4d47
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.OrgEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.constants.XJConstant
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Attachment
;
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.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProjectService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -25,11 +35,45 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
@Autowired
ProjectMapper
projectMapper
;
@Autowired
AttachmentServiceImpl
attachmentService
;
@Autowired
ProjectInitiationServiceImpl
projectInitiationService
;
@Autowired
EquipmentServiceImpl
equipmentService
;
/**
* 分页查询
*/
public
Page
<
ProjectDto
>
queryForProjectPage
(
Page
<
ProjectDto
>
page
,
String
name
,
String
constructionUnit
)
{
return
this
.
queryForPage
(
page
,
null
,
false
,
name
,
constructionUnit
);
Page
<
ProjectDto
>
projectDtoPage
=
this
.
queryForPage
(
page
,
null
,
false
,
name
,
constructionUnit
);
List
<
ProjectDto
>
projects
=
projectDtoPage
.
getRecords
();
for
(
ProjectDto
project:
projects
){
getProjectState
(
project
);
}
return
projectDtoPage
;
}
private
void
getProjectState
(
ProjectDto
project
)
{
String
state
=
""
,
insDep
=
""
,
insPerson
=
""
;
LambdaQueryWrapper
<
ProjectInitiation
>
lambdaQueryWrap
=
new
LambdaQueryWrapper
<>();
lambdaQueryWrap
.
eq
(
ProjectInitiation:
:
getInstanceId
,
project
.
getInstanceId
())
.
orderByDesc
(
ProjectInitiation:
:
getSequenceNbr
);
List
<
ProjectInitiation
>
projectInitiationList
=
projectInitiationService
.
list
(
lambdaQueryWrap
);
if
(!
ValidationUtil
.
isEmpty
(
projectInitiationList
)){
ProjectInitiation
projectInitiation
=
projectInitiationList
.
iterator
().
next
();
JSONObject
jsonObject
=
JSON
.
parseObject
(
projectInitiation
.
getContext
());
state
=
jsonObject
.
getString
(
XJConstant
.
PROCESS_PROJECT_STATE
);
insDep
=
jsonObject
.
getString
(
XJConstant
.
INS_DEP
);
insPerson
=
jsonObject
.
getString
(
XJConstant
.
INS_PRESON
);
}
project
.
setExamineProjectState
(
state
);
project
.
setInsDep
(
insDep
);
project
.
setInsPerson
(
insPerson
);
}
...
...
@@ -64,8 +108,61 @@ public class ProjectServiceImpl extends BaseService<ProjectDto, Project, Project
* @return
*/
public
List
<
Project
>
selectByidList
(
List
<
Long
>
ids
){
return
projectMapper
.
selectBatchIds
(
ids
);
}
public
ProjectDto
getDetail
(
Long
sequenceNbr
){
ProjectDto
project
=
projectMapper
.
getDetail
(
sequenceNbr
);
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
try
{
JSONArray
jsonArray
=
JSON
.
parseArray
(
attachmentService
.
getOne
(
wrapper
).
getInfo
());
project
.
setSubForm
(
jsonArray
);
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"该项目暂无附件"
);
}
project
.
getInstanceId
();
getProjectState
(
project
);
return
project
;
}
public
String
saveOrUpdateFile
(
JSONObject
jsonObject
){
JSONArray
subForm
=
jsonObject
.
getJSONArray
(
"subForm"
);
Long
sequenceNbr
=
jsonObject
.
getLong
(
"sequenceNbr"
);
LambdaQueryWrapper
<
Attachment
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Attachment:
:
getSourceId
,
sequenceNbr
);
Attachment
attachment
=
attachmentService
.
getOne
(
wrapper
);
if
(
ValidationUtil
.
isEmpty
(
attachment
)){
equipmentService
.
saveAttachment
(
subForm
,
sequenceNbr
);
}
else
{
attachment
.
setInfo
(
JSON
.
toJSONString
(
subForm
));
attachmentService
.
updateById
(
attachment
);
}
Project
project
=
this
.
getById
(
sequenceNbr
);
ProjectDto
projectDto
=
new
ProjectDto
();
BeanUtils
.
copyProperties
(
project
,
projectDto
);
projectDto
.
setInsDep
(
jsonObject
.
getString
(
"insDep"
));
projectDto
.
setInsDep
(
jsonObject
.
getString
(
"insPerson"
));
projectDto
.
setProcessProjectState
(
jsonObject
.
getString
(
"processProjectState"
));
boolean
design
=
false
,
install
=
false
;
for
(
Object
object:
subForm
){
JSONObject
jo
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
object
));
String
type
=
jo
.
getString
(
"type"
);
if
(
OrgEnum
.
设计单位
.
getKey
().
equals
(
type
)){
design
=
true
;
}
if
(
OrgEnum
.
安装单位
.
getKey
().
equals
(
type
)){
design
=
true
;
}
}
if
(
design
&&
install
){
projectInitiationService
.
execute
(
project
.
getInstanceId
(),
projectDto
,
"1"
);
}
this
.
updateById
(
project
);
return
"ok"
;
}
}
\ No newline at end of file
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