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
cf962e18
Commit
cf962e18
authored
May 15, 2024
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.检验检测-J065
parent
3246ce83
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
150 additions
and
111 deletions
+150
-111
JyjcInspectionApplication.java
...oot/module/jyjc/api/entity/JyjcInspectionApplication.java
+6
-0
JyjcInspectionApplicationModel.java
...module/jyjc/api/model/JyjcInspectionApplicationModel.java
+4
-0
CommonController.java
...mos/boot/module/jyjc/biz/controller/CommonController.java
+28
-15
JyjcInspectionApplicationController.java
...c/biz/controller/JyjcInspectionApplicationController.java
+0
-3
ESEquipmentCategory.java
...in/amos/boot/module/jyjc/biz/dao/ESEquipmentCategory.java
+10
-0
CommonserviceImpl.java
.../boot/module/jyjc/biz/service/impl/CommonserviceImpl.java
+38
-42
InspectionPlanServiceImpl.java
...dule/jyjc/biz/service/impl/InspectionPlanServiceImpl.java
+48
-2
JyjcInspectionApplicationServiceImpl.java
...iz/service/impl/JyjcInspectionApplicationServiceImpl.java
+2
-34
JyjcOpeningApplicationServiceImpl.java
...c/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
+10
-10
TzBaseEnterpriseInfoMapper.java
...oot/module/ymt/api/mapper/TzBaseEnterpriseInfoMapper.java
+3
-4
TzBaseEnterpriseInfoMapper.xml
.../src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
+1
-1
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/entity/JyjcInspectionApplication.java
View file @
cf962e18
...
...
@@ -46,6 +46,12 @@ public class JyjcInspectionApplication extends BaseEntity {
private
String
equipClassify
;
/**
* 设备类别code
*/
@TableField
(
"equ_category"
)
private
String
equCategory
;
/**
* 报检单号
*/
@TableField
(
"application_no"
)
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/model/JyjcInspectionApplicationModel.java
View file @
cf962e18
...
...
@@ -149,6 +149,10 @@ public class JyjcInspectionApplicationModel extends BaseModel {
@ApiModelProperty
(
value
=
"设备分类"
)
private
String
equList
;
@ApiModelProperty
(
value
=
"设备类别code"
)
private
String
equCategory
;
@ApiModelProperty
(
value
=
"监管码"
)
private
String
supervisoryCode
;
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/CommonController.java
View file @
cf962e18
...
...
@@ -10,6 +10,8 @@ import com.yeejoin.amos.boot.module.jyjc.biz.service.impl.EquipRegularlyRemindSe
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
...
...
@@ -20,7 +22,6 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -42,6 +43,8 @@ public class CommonController extends BaseController {
@Autowired
EquipRegularlyRemindServicelmpl
equipRegularlyRemindServicelmpl
;
private
final
static
String
SBZL_DICT_PRIFIX
=
"JYJC_SBZL"
;
/**
* 新增
*
...
...
@@ -65,18 +68,18 @@ public class CommonController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/getUserPhonesByPersonCode"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据公司的unitCode获取检测检验人员联系电话"
,
notes
=
"根据公司的unitCode获取检测检验人员联系电话"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getUserPhonesByPersonCode
(
@RequestParam
String
unitCode
)
{
public
ResponseModel
<
Map
<
String
,
Object
>>
getUserPhonesByPersonCode
(
@RequestParam
String
unitCode
)
{
if
(
unitCode
.
contains
(
"_"
))
{
unitCode
=
unitCode
.
split
(
"_"
)[
0
];
}
List
<
TzsUserInfo
>
userPhones
=
commonserviceImpl
.
getUserPhonesByPersonCode
(
unitCode
);
if
(
CollectionUtils
.
isEmpty
(
userPhones
)){
if
(
CollectionUtils
.
isEmpty
(
userPhones
))
{
return
null
;
}
List
<
String
>
phones
=
userPhones
.
stream
().
map
(
TzsUserInfo:
:
getPhone
).
collect
(
Collectors
.
toList
());
String
phone
=
String
.
join
(
","
,
phones
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"phone"
,
phone
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"phone"
,
phone
);
return
ResponseHelper
.
buildResponse
(
map
);
}
...
...
@@ -84,20 +87,21 @@ public class CommonController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/getInnerPersonCodeByPersonCode"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据公司的unitCode获取检测检验人员内部编号"
,
notes
=
"根据公司的unitCode获取检测检验人员内部编号"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
getInnerPersonCodeByPersonCode
(
@RequestParam
String
unitCode
)
{
public
ResponseModel
<
Map
<
String
,
Object
>>
getInnerPersonCodeByPersonCode
(
@RequestParam
String
unitCode
)
{
if
(
unitCode
.
contains
(
"_"
))
{
unitCode
=
unitCode
.
split
(
"_"
)[
0
];
}
List
<
TzsUserInfo
>
userPhones
=
commonserviceImpl
.
getUserPhonesByPersonCode
(
unitCode
);
if
(
CollectionUtils
.
isEmpty
(
userPhones
)){
if
(
CollectionUtils
.
isEmpty
(
userPhones
))
{
return
null
;
}
List
<
String
>
phones
=
userPhones
.
stream
().
filter
(
e
->
StringUtils
.
isNotEmpty
(
e
.
getInnerPersonCode
())).
map
(
TzsUserInfo:
:
getInnerPersonCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
CollectionUtils
.
isEmpty
(
phones
)){
map
.
put
(
"innerPersonCode"
,
" "
);
}
else
{
String
innerPersonCode
=
String
.
join
(
","
,
phones
);
map
.
put
(
"innerPersonCode"
,
innerPersonCode
);
List
<
String
>
phones
=
userPhones
.
stream
().
filter
(
e
->
StringUtils
.
isNotEmpty
(
e
.
getInnerPersonCode
())).
map
(
TzsUserInfo:
:
getInnerPersonCode
).
collect
(
Collectors
.
toList
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
CollectionUtils
.
isEmpty
(
phones
))
{
map
.
put
(
"innerPersonCode"
,
" "
);
}
else
{
String
innerPersonCode
=
String
.
join
(
","
,
phones
);
map
.
put
(
"innerPersonCode"
,
innerPersonCode
);
}
return
ResponseHelper
.
buildResponse
(
map
);
...
...
@@ -140,7 +144,7 @@ public class CommonController extends BaseController {
@PostMapping
(
value
=
"/bj/transfer"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"公共转办接口"
,
notes
=
"公共转办接口"
)
public
ResponseModel
<
Object
>
transferBJ
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"key"
,
"instance_id"
);
map
.
put
(
"key"
,
"instance_id"
);
Object
result
=
taskModelService
.
transfer
(
map
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
@@ -154,7 +158,7 @@ public class CommonController extends BaseController {
@PostMapping
(
value
=
"/kt/transfer"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"公共转办接口"
,
notes
=
"公共转办接口"
)
public
ResponseModel
<
Object
>
transferKT
(
@RequestBody
Map
<
String
,
Object
>
map
)
{
map
.
put
(
"key"
,
"workflow_prostance_id"
);
map
.
put
(
"key"
,
"workflow_prostance_id"
);
Object
result
=
taskModelService
.
transfer
(
map
);
return
ResponseHelper
.
buildResponse
(
result
);
}
...
...
@@ -167,4 +171,13 @@ public class CommonController extends BaseController {
@ApiParam
(
value
=
"人员类型"
,
allowableValues
=
"jy,jc"
)
@RequestParam
String
personType
)
{
return
ResponseHelper
.
buildResponse
(
commonserviceImpl
.
getUserListByUnitCodeAndPost
(
unitCode
,
personType
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/equList"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"按照业务类型查询设备种类,工作台使用"
,
notes
=
"按照业务类型查询设备种类,工作台使用"
)
public
ResponseModel
<
List
<
DictionarieValueModel
>>
equList
(
@RequestParam
(
value
=
"inspectionType"
)
String
bizType
)
{
String
dictCode
=
String
.
format
(
"%s_%s"
,
SBZL_DICT_PRIFIX
,
bizType
);
return
ResponseHelper
.
buildResponse
(
Systemctl
.
dictionarieClient
.
dictValues
(
dictCode
).
getResult
());
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/JyjcInspectionApplicationController.java
View file @
cf962e18
...
...
@@ -155,7 +155,6 @@ public class JyjcInspectionApplicationController extends BaseController {
ReginParams
reginParams
=
getSelectedOrgInfo
();
inspectionUnitCode
=
reginParams
.
getCompany
().
getCompanyCode
();
List
<
String
>
roleIds
=
StrUtil
.
split
(
roles
,
","
);
return
ResponseHelper
.
buildResponse
(
jyjcInspectionApplicationServiceImpl
.
queryForJyjcInspectionApplicationPage
(
page
,
applicationNo
,
inspectionClassify
,
applicationUnitCode
,
equipClassify
,
inspectionUnitCode
,
applicationUnitName
,
inspectionUnitName
,
applicationDate
,
acceptDate
,
inspectionChargePerson
,
status
,
bizType
));
}
...
...
@@ -183,8 +182,6 @@ public class JyjcInspectionApplicationController extends BaseController {
page
.
setSize
(
size
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
applicationUnitCode
=
reginParams
.
getCompany
().
getCompanyCode
();
List
<
String
>
roleIds
=
StrUtil
.
split
(
roles
,
","
);
// return ResponseHelper.buildResponse(jyjcInspectionApplicationServiceImpl.queryForJyjcInspectionApplicationPage(page,applicationNo,inspectionClassify,applicationUnitCode,equipClassify,inspectionUnitCode,applicationUnitName,inspectionUnitName,applicationDate,acceptDate,inspectionChargePerson,status,bizType,roleIds));
return
ResponseHelper
.
buildResponse
(
jyjcInspectionApplicationServiceImpl
.
queryForJyjcInspectionApplicationPage
(
page
,
applicationNo
,
inspectionClassify
,
applicationUnitCode
,
equipClassify
,
inspectionUnitCode
,
applicationUnitName
,
inspectionUnitName
,
applicationDate
,
acceptDate
,
inspectionChargePerson
,
status
,
bizType
));
}
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/dao/ESEquipmentCategory.java
0 → 100644
View file @
cf962e18
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
dao
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto
;
import
org.springframework.data.repository.PagingAndSortingRepository
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
ESEquipmentCategory
extends
PagingAndSortingRepository
<
ESEquipmentCategoryDto
,
String
>
{
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/CommonserviceImpl.java
View file @
cf962e18
...
...
@@ -11,7 +11,6 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.OpenBizTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.TzsUserInfoDto
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzBaseEnterpriseInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.TzsUserInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum
;
...
...
@@ -21,23 +20,21 @@ 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.TaskV2Model
;
import
com.yeejoin.amos.feign.workflow.model.FlowTaskVo
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
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.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.io.UnsupportedEncodingException
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Modifier
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Service
public
class
CommonserviceImpl
{
...
...
@@ -64,7 +61,6 @@ public class CommonserviceImpl {
@Autowired
TzBaseEnterpriseInfoMapper
enterpriseInfoMapper
;
public
static
final
String
UNIT_TYPE
=
"检验检测机构"
;
/**
* @return ReginParams
...
...
@@ -79,7 +75,7 @@ public class CommonserviceImpl {
QueryWrapper
userInfoQueryWrapper
=
new
QueryWrapper
<>();
userInfoQueryWrapper
.
eq
(
"unit_code"
,
unitCode
);
userInfoQueryWrapper
.
like
(
"post"
,
jyjcUserPost
);
userInfoQueryWrapper
.
eq
(
"is_delete"
,
false
);
userInfoQueryWrapper
.
eq
(
"is_delete"
,
false
);
List
<
TzsUserInfo
>
userInfos
=
userInfoMapper
.
selectList
(
userInfoQueryWrapper
);
return
userInfos
;
}
...
...
@@ -87,17 +83,17 @@ public class CommonserviceImpl {
public
List
<
TzsUserInfo
>
getUserListByUnitCodeAndPost
(
String
unitCode
,
String
personType
)
{
LambdaQueryWrapper
<
TzsUserInfo
>
userInfoQueryWrapper
=
new
LambdaQueryWrapper
<>();
userInfoQueryWrapper
.
eq
(
TzsUserInfo:
:
getUnitCode
,
unitCode
);
this
.
castPersonType2Post
(
userInfoQueryWrapper
,
personType
);
userInfoQueryWrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
false
);
userInfoQueryWrapper
.
select
(
TzsUserInfo:
:
getPost
,
TzsUserInfo:
:
getPhone
,
TzsUserInfo:
:
getName
,
TzsUserInfo:
:
getInnerPersonCode
,
BaseEntity:
:
getSequenceNbr
);
this
.
castPersonType2Post
(
userInfoQueryWrapper
,
personType
);
userInfoQueryWrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
false
);
userInfoQueryWrapper
.
select
(
TzsUserInfo:
:
getPost
,
TzsUserInfo:
:
getPhone
,
TzsUserInfo:
:
getName
,
TzsUserInfo:
:
getInnerPersonCode
,
BaseEntity:
:
getSequenceNbr
);
return
userInfoMapper
.
selectList
(
userInfoQueryWrapper
);
}
private
void
castPersonType2Post
(
LambdaQueryWrapper
<
TzsUserInfo
>
userInfoQueryWrapper
,
String
personType
)
{
if
(
personType
.
equals
(
OpenBizTypeEnum
.
JY
.
getCode
()))
{
if
(
personType
.
equals
(
OpenBizTypeEnum
.
JY
.
getCode
()))
{
userInfoQueryWrapper
.
like
(
TzsUserInfo:
:
getPost
,
jyUserPost
);
}
if
(
personType
.
equals
(
OpenBizTypeEnum
.
JC
.
getCode
()))
{
if
(
personType
.
equals
(
OpenBizTypeEnum
.
JC
.
getCode
()))
{
userInfoQueryWrapper
.
like
(
TzsUserInfo:
:
getPost
,
jcUserPost
);
}
}
...
...
@@ -107,7 +103,7 @@ public class CommonserviceImpl {
userInfoQueryWrapper
.
eq
(
"unit_code"
,
unitCode
);
userInfoQueryWrapper
.
like
(
"post"
,
jyjcBizUserPost
);
userInfoQueryWrapper
.
isNotNull
(
"amos_user_id"
);
userInfoQueryWrapper
.
eq
(
"is_delete"
,
false
);
userInfoQueryWrapper
.
eq
(
"is_delete"
,
false
);
List
<
TzsUserInfo
>
userInfos
=
userInfoMapper
.
selectList
(
userInfoQueryWrapper
);
return
userInfos
;
}
...
...
@@ -123,7 +119,7 @@ public class CommonserviceImpl {
public
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitList
()
{
return
enterpriseInfoMapper
.
getInspectionUnitList
(
UNIT_TYPE
);
return
enterpriseInfoMapper
.
getInspectionUnitList
();
}
public
TzBaseEnterpriseInfo
getInspectionUnitBySequenceNbr
(
Long
sequenceNbr
)
{
...
...
@@ -131,29 +127,29 @@ public class CommonserviceImpl {
}
public
void
buildTaskModel
(
Map
<
String
,
Object
>
params
){
public
void
buildTaskModel
(
Map
<
String
,
Object
>
params
)
{
TaskV2Model
model
=
new
TaskV2Model
();
//获取待办任务执行人
Map
<
String
,
Object
>
nextNodeInfo
=
workflowHelper
.
getNextWorkflowNode
(
params
.
get
(
"instanceId"
).
toString
());
String
role
=
(
String
)
nextNodeInfo
.
get
(
"role"
);
model
.
setExecuteUserIds
(
role
);
List
<
AgencyUserModel
>
userList
=
Privilege
.
agencyUserClient
.
queryByRoleId
(
role
,
null
,
false
).
getResult
();
.
queryByRoleId
(
role
,
null
,
false
).
getResult
();
List
<
String
>
userIds
=
userList
.
stream
().
map
(
AgencyUserModel:
:
getUserId
).
collect
(
Collectors
.
toList
());
model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)
?
""
:
String
.
join
(
","
,
userIds
));
model
.
setExtras
(
params
.
getOrDefault
(
"extras"
,
""
).
toString
());
model
.
setRelationId
(
params
.
getOrDefault
(
"instanceId"
,
""
).
toString
());
model
.
setRoutePath
(
params
.
getOrDefault
(
"routePath"
,
""
).
toString
());
model
.
setStartDate
((
Date
)
params
.
getOrDefault
(
"startDate"
,
""
));
model
.
setStartUserId
(
params
.
getOrDefault
(
"startUserId"
,
""
).
toString
());
model
.
setTaskContent
(
params
.
getOrDefault
(
"taskContent"
,
""
).
toString
());
model
.
setTaskType
(
params
.
getOrDefault
(
"taskType"
,
""
).
toString
());
model
.
setTaskTypeLabel
(
params
.
getOrDefault
(
"taskTypeLabel"
,
""
).
toString
());
model
.
setTaskTitle
(
params
.
getOrDefault
(
"taskTitle"
,
""
).
toString
());
model
.
setTaskName
(
params
.
getOrDefault
(
"taskName"
,
""
).
toString
());
model
.
setTaskStatus
(
Integer
.
valueOf
(
params
.
getOrDefault
(
"taskStatus"
,
0
).
toString
()));
model
.
setTaskStatusLabel
(
params
.
getOrDefault
(
"taskStatusLabel"
,
""
).
toString
());
model
.
setTaskSource
(
params
.
getOrDefault
(
"taskSource"
,
"workFlow"
).
toString
());
model
.
setExecuteUserIds
(
CollectionUtils
.
isEmpty
(
userIds
)
?
""
:
String
.
join
(
","
,
userIds
));
model
.
setExtras
(
params
.
getOrDefault
(
"extras"
,
""
).
toString
());
model
.
setRelationId
(
params
.
getOrDefault
(
"instanceId"
,
""
).
toString
());
model
.
setRoutePath
(
params
.
getOrDefault
(
"routePath"
,
""
).
toString
());
model
.
setStartDate
((
Date
)
params
.
getOrDefault
(
"startDate"
,
""
));
model
.
setStartUserId
(
params
.
getOrDefault
(
"startUserId"
,
""
).
toString
());
model
.
setTaskContent
(
params
.
getOrDefault
(
"taskContent"
,
""
).
toString
());
model
.
setTaskType
(
params
.
getOrDefault
(
"taskType"
,
""
).
toString
());
model
.
setTaskTypeLabel
(
params
.
getOrDefault
(
"taskTypeLabel"
,
""
).
toString
());
model
.
setTaskTitle
(
params
.
getOrDefault
(
"taskTitle"
,
""
).
toString
());
model
.
setTaskName
(
params
.
getOrDefault
(
"taskName"
,
""
).
toString
());
model
.
setTaskStatus
(
Integer
.
valueOf
(
params
.
getOrDefault
(
"taskStatus"
,
0
).
toString
()));
model
.
setTaskStatusLabel
(
params
.
getOrDefault
(
"taskStatusLabel"
,
""
).
toString
());
model
.
setTaskSource
(
params
.
getOrDefault
(
"taskSource"
,
"workFlow"
).
toString
());
// model.setTerminal(params.getOrDefault("terminal","WEB").toString());
model
.
setCreateDate
(
new
Date
());
//model.setFinishStatus(false);
...
...
@@ -164,10 +160,10 @@ public class CommonserviceImpl {
}
public
TaskV2Model
updateTaskModel
(
Map
<
String
,
Object
>
params
)
{
public
TaskV2Model
updateTaskModel
(
Map
<
String
,
Object
>
params
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
TaskV2Model
model
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getCreateDate
().
compareTo
(
r1
.
getCreateDate
()))
// 按时间降序排序
.
findFirst
()
.
orElse
(
null
);
...
...
@@ -175,9 +171,9 @@ public class CommonserviceImpl {
model
.
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
model
.
setEndUserId
(
reginParams
.
getUserModel
().
getUserId
());
model
.
setEndDate
(
new
Date
());
model
.
setRoutePath
(
model
.
getRoutePath
().
replace
(
"roleIds"
,
"role"
).
replace
(
"edit"
,
"look"
));
model
.
setRoutePath
(
model
.
getRoutePath
().
replace
(
"roleIds"
,
"role"
).
replace
(
"edit"
,
"look"
));
//model.setFinishStatus(true);
Systemctl
.
taskV2Client
.
update
(
model
,
model
.
getSequenceNbr
());
Systemctl
.
taskV2Client
.
update
(
model
,
model
.
getSequenceNbr
());
//修改model并返回 用于组装新待办
model
.
setEndUserId
(
null
);
...
...
@@ -193,15 +189,15 @@ public class CommonserviceImpl {
}
@Async
public
void
sendMessage
(
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
phones
)
{
public
void
sendMessage
(
HashMap
<
String
,
String
>
smsParams
,
List
<
String
>
phones
)
{
for
(
String
phone
:
phones
)
{
smsParams
.
put
(
"mobile"
,
phone
);
smsParams
.
put
(
"mobile"
,
phone
);
Systemctl
.
smsClient
.
sendCommonSms
(
smsParams
);
}
}
public
void
deleteTaskModel
(
String
id
)
{
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
id
).
getResult
();
public
void
deleteTaskModel
(
String
id
)
{
List
<
TaskV2Model
>
result
=
Systemctl
.
taskV2Client
.
selectListByRelationId
(
id
).
getResult
();
TaskV2Model
model
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getCreateDate
().
compareTo
(
r1
.
getCreateDate
()))
// 按时间降序排序
.
findFirst
()
.
orElse
(
null
);
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/InspectionPlanServiceImpl.java
View file @
cf962e18
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jyjc
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplicationEquip
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.InspectionPlanModel
;
import
com.yeejoin.amos.boot.module.jyjc.biz.dao.ESEquipmentCategory
;
import
com.yeejoin.amos.boot.module.ymt.api.dto.ESEquipmentCategoryDto
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.rdbms.orm.entity.BaseEntity
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
/**
* @author Administrator
*/
...
...
@@ -15,8 +23,16 @@ public class InspectionPlanServiceImpl {
private
JyjcInspectionApplicationServiceImpl
inspectionApplicationService
;
public
InspectionPlanServiceImpl
(
JyjcInspectionApplicationServiceImpl
inspectionApplicationService
)
{
private
JyjcInspectionApplicationEquipServiceImpl
applicationEquipService
;
private
ESEquipmentCategory
esEquipmentCategory
;
public
InspectionPlanServiceImpl
(
JyjcInspectionApplicationServiceImpl
inspectionApplicationService
,
JyjcInspectionApplicationEquipServiceImpl
applicationEquipService
,
ESEquipmentCategory
esEquipmentCategory
)
{
this
.
inspectionApplicationService
=
inspectionApplicationService
;
this
.
applicationEquipService
=
applicationEquipService
;
this
.
esEquipmentCategory
=
esEquipmentCategory
;
}
...
...
@@ -31,6 +47,36 @@ public class InspectionPlanServiceImpl {
public
JSONObject
getDetail
(
String
applicationSeq
)
{
JyjcInspectionApplication
inspectionApplication
=
inspectionApplicationService
.
getById
(
applicationSeq
);
// 初始时查询设备地址关联设备表
return
inspectionApplication
.
getPlanData
();
JSONObject
jsonObject
=
inspectionApplication
.
getPlanData
();
if
(
jsonObject
==
null
){
jsonObject
=
new
JSONObject
();
String
address
=
this
.
getOneEquipAddress
(
applicationSeq
);
jsonObject
.
put
(
"address"
,
address
);
}
return
jsonObject
;
}
private
String
getOneEquipAddress
(
String
applicationSeq
)
{
// 查询报检的设备,返回地址,目前是单台报检,applicationEquips长度只有1,后续会多个
List
<
JyjcInspectionApplicationEquip
>
applicationEquips
=
applicationEquipService
.
list
(
new
LambdaQueryWrapper
<
JyjcInspectionApplicationEquip
>().
eq
(
JyjcInspectionApplicationEquip:
:
getApplicationSeq
,
applicationSeq
));
// 拼接地址
List
<
String
>
allAddress
=
new
ArrayList
<>();
applicationEquips
.
forEach
(
e
->{
String
record
=
e
.
getEquipUnicode
();
Optional
<
ESEquipmentCategoryDto
>
optional
=
esEquipmentCategory
.
findById
(
record
);
if
(
optional
.
isPresent
()){
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
optional
.
get
();
allAddress
.
add
(
this
.
concatDetailAddress
(
esEquipmentCategoryDto
));
}
});
return
String
.
join
(
","
,
allAddress
);
}
private
String
concatDetailAddress
(
ESEquipmentCategoryDto
esEquipmentCategoryDto
)
{
// 省、市、区
String
usePlace
=
esEquipmentCategoryDto
.
getUSE_PLACE
();
// 详细地址
String
address
=
esEquipmentCategoryDto
.
getADDRESS
();
return
String
.
format
(
"%s%s"
,
usePlace
,
address
);
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionApplicationServiceImpl.java
View file @
cf962e18
...
...
@@ -121,6 +121,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
@Autowired
JyjcOpeningApplicationServiceImpl
openingApplicationService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
JyjcInspectionApplicationModel
save
(
@RequestBody
JSONObject
obj
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
...
...
@@ -653,6 +654,7 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
* @author yangyang
* @date 2023/12/15 15:14
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
doReject
(
Map
<
String
,
Object
>
params
)
{
Long
sequenceNbr
=
Long
.
parseLong
(
params
.
get
(
"sequenceNbr"
)
+
""
);
...
...
@@ -709,42 +711,9 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
executeOneStep
(
model
,
taskName1
,
nextUserIds
);
BeanUtils
.
copyProperties
(
model
,
entity
);
this
.
updateById
(
entity
);
// updateModelByInstanceId(sequenceNbr, instanceId, params, rollBack);
return
true
;
}
/**
* 接收/驳回通知检验单
*/
public
void
execueFlow
(
Map
<
String
,
Object
>
params
)
{
String
op
=
params
.
get
(
"op"
).
toString
();
String
instanceId
=
params
.
get
(
"instanceId"
).
toString
();
String
comments
=
params
.
get
(
"comments"
).
toString
();
try
{
AjaxResult
ajaxResult
=
Workflow
.
taskClient
.
getTaskNoAuth
(
instanceId
);
JSONObject
dataObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
ajaxResult
.
get
(
"data"
)));
if
(
ValidationUtil
.
isEmpty
(
dataObject
))
{
log
.
warn
(
"流程已结束, instanceId => {}"
,
instanceId
);
return
;
}
String
taskId
=
dataObject
.
getString
(
"id"
);
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResultCode
(
"approvalStatus"
);
dto
.
setTaskId
(
taskId
);
HashMap
<
String
,
Object
>
varibalble
=
new
HashMap
<>();
varibalble
.
put
(
"approvalStatus"
,
op
);
dto
.
setVariable
(
varibalble
);
dto
.
setComment
(
comments
);
// 执行流程
AjaxResult
ajaxResult1
=
Workflow
.
taskClient
.
completeByTask
(
taskId
,
dto
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"执行工作流错误, => {}"
,
params
,
e
);
throw
new
BaseException
(
"该项流程发生变化,刷新查看状态后重试"
,
"400"
,
""
);
}
}
/**
* 撤回流程办理单
...
...
@@ -805,7 +774,6 @@ public class JyjcInspectionApplicationServiceImpl extends BaseService<JyjcInspec
}
String
status
=
(
String
)
params
.
get
(
"status"
);
List
<
String
>
persons
=
JSONArray
.
parseArray
(
JSON
.
toJSONString
(
params
.
get
(
"inspectionChargePerson"
)),
String
.
class
);
// List<String> phones = JSONArray.parseArray(JSON.toJSONString(params.get("inspectionChargePhone")), String.class);
String
inspectionChargePerson
=
persons
==
null
?
""
:
String
.
join
(
","
,
persons
);
if
(
StringUtils
.
isNotBlank
(
inspectionChargePerson
))
{
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcOpeningApplicationServiceImpl.java
View file @
cf962e18
...
...
@@ -146,7 +146,6 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
private
final
static
String
ZZXM_JYJC_DICT_KEY
=
"ZZXM_JYJC_ALL"
;
@Transactional
(
rollbackFor
=
{
Exception
.
class
,
BaseException
.
class
})
public
JyjcOpeningApplicationModel
saveOrUpdateModel
(
JyjcOpeningApplicationModel
model
,
Boolean
enableStartFlow
)
{
boolean
isUpdate
=
false
;
...
...
@@ -441,7 +440,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
if
(!
ValidationUtil
.
isEmpty
(
userInfos
))
{
List
<
TzsUserInfoVo
>
tzsUserInfoVos
=
userInfos
.
stream
().
map
(
userInfo
->
{
TzsUserInfoVo
vo
=
new
TzsUserInfoVo
();
BeanUtils
.
copyProperties
(
userInfo
,
vo
,
"identification"
,
"profile"
,
"permissionItem"
,
"appointDoc"
);
BeanUtils
.
copyProperties
(
userInfo
,
vo
,
"identification"
,
"profile"
,
"permissionItem"
,
"appointDoc"
);
if
(!
ObjectUtils
.
isEmpty
(
userInfo
.
getPermissionItem
()))
{
vo
.
setPermissionItem
(
JSON
.
parseArray
(
userInfo
.
getPermissionItem
()));
vo
.
setPermissionItemName
(
this
.
castItemCode2Name
(
userInfo
.
getPermissionItem
()));
...
...
@@ -479,24 +478,24 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
}
private
String
castItemCode2Name
(
String
permissionItem
)
{
if
(
permissionItemList
==
null
)
{
if
(
permissionItemList
==
null
)
{
FeignClientResult
<
List
<
DictionarieValueModel
>>
itemDicts
=
Systemctl
.
dictionarieClient
.
dictValues
(
ZZXM_JYJC_DICT_KEY
);
permissionItemList
=
itemDicts
.
getResult
();
}
return
permissionItemList
.
stream
().
filter
(
i
->
permissionItem
.
contains
(
i
.
getDictDataKey
())).
map
(
this
::
buildItemWithCode
).
collect
(
Collectors
.
joining
(
","
));
return
permissionItemList
.
stream
().
filter
(
i
->
permissionItem
.
contains
(
i
.
getDictDataKey
())).
map
(
this
::
buildItemWithCode
).
collect
(
Collectors
.
joining
(
","
));
}
private
String
buildItemWithCode
(
DictionarieValueModel
d
)
{
return
String
.
format
(
"%s[%s]"
,
d
.
getDictDataValue
(),
d
.
getDictDataKey
());
return
String
.
format
(
"%s[%s]"
,
d
.
getDictDataValue
(),
d
.
getDictDataKey
());
}
private
String
getDictNameByCode
(
String
permissionLevel
)
{
if
(
StringUtils
.
isEmpty
(
permissionLevel
))
{
if
(
StringUtils
.
isEmpty
(
permissionLevel
))
{
return
""
;
}
if
(
permissionLevelMap
==
null
)
{
if
(
permissionLevelMap
==
null
)
{
FeignClientResult
<
List
<
DictionarieValueModel
>>
levelDicts
=
Systemctl
.
dictionarieClient
.
dictValues
(
RYJB_JYJC_DICT_KEY
);
permissionLevelMap
=
levelDicts
.
getResult
().
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
Function
.
identity
(),
(
k1
,
k2
)->
k2
));
permissionLevelMap
=
levelDicts
.
getResult
().
stream
().
collect
(
Collectors
.
toMap
(
DictionarieValueModel:
:
getDictDataKey
,
Function
.
identity
(),
(
k1
,
k2
)
->
k2
));
}
return
Optional
.
ofNullable
(
permissionLevelMap
.
get
(
permissionLevel
).
getDictDataValue
()).
orElse
(
""
);
}
...
...
@@ -630,7 +629,7 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
}
public
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitList
()
{
List
<
TzBaseEnterpriseInfoDto
>
tzBaseEnterpriseInfos
=
enterpriseInfoMapper
.
getInspectionUnitList
(
CommonserviceImpl
.
UNIT_TYPE
);
List
<
TzBaseEnterpriseInfoDto
>
tzBaseEnterpriseInfos
=
enterpriseInfoMapper
.
getInspectionUnitList
();
if
(
ValidationUtil
.
isEmpty
(
tzBaseEnterpriseInfos
))
{
return
Collections
.
EMPTY_LIST
;
}
...
...
@@ -720,6 +719,6 @@ public class JyjcOpeningApplicationServiceImpl extends BaseService<JyjcOpeningAp
@Override
public
List
<
TzBaseEnterpriseInfoDto
>
getUnitListByRecord
(
String
record
)
{
return
ruleActionHandler
.
getInspectionUnitList
(
new
ArrayList
<>(),
true
,
record
,
OpenBizTypeEnum
.
JC
.
getCode
());
return
ruleActionHandler
.
getInspectionUnitList
(
new
ArrayList
<>(),
true
,
record
,
OpenBizTypeEnum
.
JC
.
getCode
());
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/java/com/yeejoin/amos/boot/module/ymt/api/mapper/TzBaseEnterpriseInfoMapper.java
View file @
cf962e18
...
...
@@ -36,6 +36,7 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
/**
* 根据企业名称查找企业详情信息
*
* @param useUnit
* @return
*/
...
...
@@ -49,20 +50,18 @@ public interface TzBaseEnterpriseInfoMapper extends BaseMapper<TzBaseEnterpriseI
/**
* 查找企业关联设备详情列表
*
*/
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitList
(
@Param
(
"unitType"
)
String
unitType
);
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitList
(
);
List
<
TzBaseEnterpriseInfoDto
>
getInspectionUnitListByCode
(
@Param
(
"list"
)
List
<
String
>
codes
,
@Param
(
"city"
)
String
city
,
@Param
(
"openBizType"
)
String
openBizType
);
/**
* 根据ID查找企业详情信息
*
*
* @param sequenceNbr sequenceNbr
* @return {@link TzBaseEnterpriseInfo}
* @author yangyang
* @throws
* @author yangyang
*/
TzBaseEnterpriseInfo
selectBySeq
(
Long
sequenceNbr
);
}
amos-boot-system-tzs/amos-boot-module-ymt/amos-boot-module-ymt-api/src/main/resources/mapper/TzBaseEnterpriseInfoMapper.xml
View file @
cf962e18
...
...
@@ -166,7 +166,7 @@
tz_base_enterprise_info info
inner JOIN tz_jyjc_opening_application tjoa ON info.use_code = tjoa.unit_code
AND status = '6616'
where unit_type LIKE CONCAT('%',#{unitType},'%')
group by info.use_code
group by info.use_code
</select>
<select
id=
"getInspectionUnitListByCode"
resultType=
"com.yeejoin.amos.boot.module.ymt.api.dto.TzBaseEnterpriseInfoDto"
>
...
...
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