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
1a36238c
Commit
1a36238c
authored
Oct 12, 2022
by
wujiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
2f686e11
c70e86ad
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
606 additions
and
192 deletions
+606
-192
ProjectInitiationEnum.java
.../amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
+40
-41
IProjectInitiationService.java
...oot/module/ugp/api/service/IProjectInitiationService.java
+2
-1
IWeldService.java
...eejoin/amos/boot/module/ugp/api/service/IWeldService.java
+2
-2
CompanyController.java
...mos/boot/module/ugp/biz/controller/CompanyController.java
+64
-2
EquipmentController.java
...s/boot/module/ugp/biz/controller/EquipmentController.java
+61
-44
MaterialController.java
...os/boot/module/ugp/biz/controller/MaterialController.java
+26
-0
ProjectController.java
...mos/boot/module/ugp/biz/controller/ProjectController.java
+15
-0
ProjectInitiationController.java
...odule/ugp/biz/controller/ProjectInitiationController.java
+3
-1
ProjectResourceController.java
.../module/ugp/biz/controller/ProjectResourceController.java
+14
-0
WeldController.java
...n/amos/boot/module/ugp/biz/controller/WeldController.java
+10
-8
EquipmentServiceImpl.java
...oot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
+31
-4
MaterialServiceImpl.java
...boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
+29
-7
OrgServiceImpl.java
...amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
+126
-0
ProjectInitiationServiceImpl.java
...le/ugp/biz/service/impl/ProjectInitiationServiceImpl.java
+63
-17
ProjectResourceServiceImpl.java
...dule/ugp/biz/service/impl/ProjectResourceServiceImpl.java
+40
-4
ProjectServiceImpl.java
.../boot/module/ugp/biz/service/impl/ProjectServiceImpl.java
+32
-7
WeldServiceImpl.java
...mos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
+48
-54
No files found.
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/Enum/ProjectInitiationEnum.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
Enum
;
public
enum
ProjectInitiationEnum
{
import
java.util.HashMap
;
import
java.util.Map
;
启动流程
(
"启动流程"
,
"/workflow/task/startTask"
,
""
),
流程详情
(
"流程详情"
,
"/workflow/task/{taskId}"
,
"taskId"
),
合并启动流程
(
"合并启动流程"
,
"/workflow/task/startProcess"
,
""
),
所有已执行任务详情
(
"所有已执行任务详情"
,
"/workflow/activitiHistory/task/detail/{taskId}"
,
"taskId"
),
流程任务
(
"流程任务"
,
"/workflow/task?processInstanceId={processInstanceId}"
,
"processInstanceId"
),
我的代办
(
"我的代办"
,
"/workflow/task/all-list?processDefinitionKey={processDefinitionKey}"
,
"processDefinitionKey"
),
我的代办有
ID
(
"我的代办有ID"
,
"/workflow/task/all-list?processDefinitionKey={processDefinitionKey}&userId={userId}"
,
"processDefinitionKey,userId"
),
已执行任务
(
"已执行任务"
,
"/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}"
,
"processDefinitionKey"
),
已执行任务有
ID
(
"已执行任务有ID"
,
"/workflow/activitiHistory/all-historytasks?processDefinitionKey={processDefinitionKey}&userId={userId}"
,
"processDefinitionKey,userId"
),
启动免登录流程
(
"启动免登录流程"
,
"/processes/{appKey}"
,
"appKey"
),
当前节点
(
"当前节点"
,
"/wf/taskstodo?processInstanceId={processInstanceId}"
,
"processInstanceId"
),
执行流程
(
"执行流程"
,
"/workflow/task/pickupAndCompleteTask/{taskId}"
,
"taskId"
),
终止流程
(
"终止流程"
,
"/wf/processes/{processInstanceId}?deleteReason={deleteReason}"
,
"processInstanceId,deleteReason"
),
当前子节点
(
"当前子节点"
,
"/wf/processes/{processInstanceId}/tasks?taskDefinitionKey={taskDefinitionKey}"
,
"processInstanceId,taskDefinitionKey"
),
工作流流水
(
"工作流流水"
,
"/wf/processes/{processInstanceId}/tasks"
,
"processInstanceId"
),
子节点信息
(
"子节点信息"
,
"/workflow/task/list/all/{instanceId}"
,
"instanceId"
);
private
String
desc
;
private
String
uri
;
private
String
params
;
ProjectInitiationEnum
(
String
desc
,
String
uri
,
String
params
)
{
this
.
desc
=
desc
;
this
.
uri
=
uri
;
this
.
params
=
params
;
public
enum
ProjectInitiationEnum
{
项目立项
(
"1"
,
"项目立项"
),
平台审核
(
"2"
,
"平台审核"
),
告知申请
(
"3"
,
"告知申请"
),
接受告知
(
"4"
,
"接受告知"
),
审查项目
(
"5"
,
"审查项目"
),
提交资料
(
"6"
,
"提交资料"
),
审批人审批
(
"7"
,
"审批人审批"
),
审核人审核
(
"8"
,
"审核人审核"
),
监检科室分配
(
"9"
,
"监检科室分配"
),
监检员分配
(
"10"
,
"监检员分配"
),
监检员审核
(
"11"
,
"监检员审核"
),
项目关闭
(
"12"
,
"项目关闭"
),
接受审查意见
(
"13"
,
"接受审查意见"
);
private
String
status
;
private
String
name
;
public
static
Map
<
String
,
String
>
getNameByStatusMap
=
new
HashMap
<
String
,
String
>();
public
static
Map
<
String
,
String
>
getStatusByNameMap
=
new
HashMap
<
String
,
String
>();
static
{
for
(
ProjectInitiationEnum
projectInitiationEnum:
ProjectInitiationEnum
.
values
()){
getNameByStatusMap
.
put
(
projectInitiationEnum
.
status
,
projectInitiationEnum
.
name
);
getStatusByNameMap
.
put
(
projectInitiationEnum
.
name
,
projectInitiationEnum
.
status
);
}
}
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
ProjectInitiationEnum
(
String
status
,
String
name
)
{
this
.
status
=
status
;
this
.
name
=
name
;
}
public
String
get
Uri
()
{
return
uri
;
public
String
get
Status
()
{
return
status
;
}
public
void
set
Uri
(
String
uri
)
{
this
.
uri
=
uri
;
public
void
set
Status
(
String
status
)
{
this
.
status
=
status
;
}
public
String
get
Params
()
{
return
params
;
public
String
get
Name
()
{
return
name
;
}
public
void
set
Params
(
String
params
)
{
this
.
params
=
params
;
public
void
set
Name
(
String
name
)
{
this
.
name
=
name
;
}
}
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IProjectInitiationService.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
public
interface
IProjectInitiationService
{
...
...
@@ -9,7 +10,7 @@ public interface IProjectInitiationService {
* @return 返回instanceId ,加入项目信息表中
* @throws Exception
*/
String
start
(
Object
objectd
);
void
start
(
Project
project
);
/**
* 执行流程节点,并记录日志
...
...
amos-boot-system-ugp/amos-boot-module-ugp-api/src/main/java/com/yeejoin/amos/boot/module/ugp/api/service/IWeldService.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
api
.
service
;
import
com.yeejoin.amos.boot.module.ugp.api.
dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.
entity.Weld
;
import
java.util.List
;
...
...
@@ -12,5 +12,5 @@ import java.util.List;
* @date 2022-09-22
*/
public
interface
IWeldService
{
void
getCode
(
Long
projectCode
,
int
number
)
throws
Exception
;
List
<
Weld
>
getCode
(
Long
projectCode
,
int
number
)
throws
Exception
;
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/CompanyController.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Company
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.CompanyMapper
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.OrgServiceImpl
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -41,6 +52,10 @@ public class CompanyController extends BaseController {
CompanyServiceImpl
companyServiceImpl
;
@Autowired
(
required
=
false
)
CompanyMapper
companyMapper
;
@Autowired
OrgUsrServiceImpl
iOrgUsrService
;
@Autowired
OrgServiceImpl
orgServiceImpl
;
/**
* 新增企业信息表
...
...
@@ -157,11 +172,58 @@ public class CompanyController extends BaseController {
// company= companyMapper.selectOne(lambdaQueryWrapper);
return
ResponseHelper
.
buildResponse
(
companyMapper
.
selectById
(
companyList
));
}
/**
* 企业审核
* 根据sequenceNbr更新,审核通过后的企业调用平台接口创建单位及管理员,并存业务的cb_org_usr表
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"check"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"根据sequenceNbr更新,并创建单位及管理员"
,
notes
=
"根据sequenceNbr更新,并创建单位及管理员"
)
public
ResponseModel
<
Boolean
>
companyCheck
(
@RequestBody
CompanyDto
model
,
Long
sequenceNbr
,
String
bizOrgType
)
throws
Exception
{
Company
company
=
companyServiceImpl
.
getById
(
sequenceNbr
);
company
.
setApproved
(
model
.
getApproved
());
if
(
company
.
getApproved
().
equals
(
"已审核"
)){
final
CompanyModel
companyModel
=
new
CompanyModel
();
final
AgencyUserModel
agencyUserModel
=
new
AgencyUserModel
();
//创建平台企业
companyModel
.
setCompanyName
(
company
.
getName
());
companyModel
.
setCompanyCode
(
company
.
getCreditCode
());
companyModel
.
setAddress
(
company
.
getAddress
());
companyModel
.
setParentId
(
0L
);
companyModel
.
setLevel
(
"headquarter"
);
companyModel
.
setAgencyCode
(
"ugp"
);
final
CompanyModel
companyModelFeignClient
=
Privilege
.
companyClient
.
create
(
companyModel
).
getResult
();
//创建平台用户
agencyUserModel
.
setRealName
(
company
.
getContact
());
agencyUserModel
.
setMobile
(
company
.
getContactPhone
());
agencyUserModel
.
setAgencyCode
(
"ugp"
);
agencyUserModel
.
setLockStatus
(
"UNLOCK"
);
// Privilege.agencyUserClient.create(agencyUserModel);
//动态表单存储
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
company
));
jsonObject
.
put
(
"amosOrgId"
,
companyModelFeignClient
.
getSequenceNbr
());
jsonObject
.
put
(
"amosOrgCode"
,
companyModelFeignClient
.
getOrgCode
());
orgServiceImpl
.
dataHandling
(
jsonObject
,
bizOrgType
);
// final OrgUsrDto orgUsrDto = new OrgUsrDto();
// orgUsrDto.setBizOrgName(company.getName());
// orgUsrDto.setAmosOrgId(companyModelFeignClient.getSequenceNbr().toString());
// orgUsrDto.setAmosOrgCode(companyModelFeignClient.getOrgCode());
// orgUsrDto.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_COMPANY);
// iOrgUsrService.saveOrgUsr(orgUsrDto);
}
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/EquipmentController.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.EquipmentServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
...
...
@@ -37,28 +42,28 @@ public class EquipmentController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增设备信息表"
,
notes
=
"新增设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
save
(
@RequestBody
EquipmentDto
model
)
{
model
=
equipmentServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增设备信息表"
,
notes
=
"新增设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
save
(
@RequestBody
EquipmentDto
model
)
{
model
=
equipmentServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新设备信息表"
,
notes
=
"根据sequenceNbr更新设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
updateBySequenceNbrEquipment
(
@RequestBody
EquipmentDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
updateWithModel
(
model
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新设备信息表"
,
notes
=
"根据sequenceNbr更新设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
updateBySequenceNbrEquipment
(
@RequestBody
EquipmentDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
updateWithModel
(
model
));
}
/**
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
...
...
@@ -67,50 +72,62 @@ public class EquipmentController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除设备信息表"
,
notes
=
"根据sequenceNbr删除设备信息表"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr
主键
* @param sequenceNbr
主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个设备信息表"
,
notes
=
"根据sequenceNbr查询单个设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个设备信息表"
,
notes
=
"根据sequenceNbr查询单个设备信息表"
)
public
ResponseModel
<
EquipmentDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表分页查询"
,
notes
=
"设备信息表分页查询"
)
public
ResponseModel
<
Page
<
EquipmentDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
EquipmentDto
>
page
=
new
Page
<
EquipmentDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentPage
(
page
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表分页查询"
,
notes
=
"设备信息表分页查询"
)
public
ResponseModel
<
Page
<
EquipmentDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
EquipmentDto
>
page
=
new
Page
<
EquipmentDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentPage
(
page
));
}
/**
* 列表全部数据查询
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表列表全部数据查询"
,
notes
=
"设备信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
EquipmentDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentList
());
}
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备信息表列表全部数据查询"
,
notes
=
"设备信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
EquipmentDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
queryForEquipmentList
());
}
/**
* 设备数据名称查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"设备数据名称查询"
,
notes
=
"设备数据名称查询"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
()
{
return
ResponseHelper
.
buildResponse
(
equipmentServiceImpl
.
selectName
());
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/MaterialController.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -113,4 +114,29 @@ public class MaterialController extends BaseController {
public
ResponseModel
<
List
<
MaterialDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
queryForMaterialList
());
}
// /**
// * 根据项目id查询材料信息
// *
// * @return
// */
// @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
// @ApiOperation(httpMethod = "GET",value = "根据项目id查询材料信息", notes = "根据项目id查询材料信息")
// @GetMapping(value = "/selectMess")
// public ResponseModel<MaterialDto> selectMess(@RequestParam String companyId ) {
// return ResponseHelper.buildResponse(materialServiceImpl.selectMess(companyId));
// }
/**
* 材料信息表列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"材料信息表列表全部数据查询"
,
notes
=
"材料信息表列表全部数据查询"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
()
{
return
ResponseHelper
.
buildResponse
(
materialServiceImpl
.
selectName
());
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectController.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -48,6 +51,9 @@ public class ProjectController extends BaseController {
model
.
setStartDate
(
new
Date
());
model
.
setSubmitDate
(
new
Date
());
model
=
projectServiceImpl
.
createWithModel
(
model
);
Project
project
=
new
Project
();
BeanUtils
.
copyProperties
(
model
,
project
);
projectInitiationService
.
start
(
project
);
return
ResponseHelper
.
buildResponse
(
model
);
}
...
...
@@ -121,4 +127,13 @@ public class ProjectController extends BaseController {
public
ResponseModel
<
List
<
ProjectDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
queryForProjectList
());
}
/**
* 查询项目名称
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"查询项目名称"
,
notes
=
"查询项目名称"
)
@GetMapping
(
value
=
"/selectName"
)
public
ResponseModel
<
List
<
JSONObject
>>
selectName
()
{
return
ResponseHelper
.
buildResponse
(
projectServiceImpl
.
selectName
());
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectInitiationController.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.biz.service.impl.ProjectInitiationServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -24,7 +25,8 @@ public class ProjectInitiationController {
@GetMapping
(
value
=
"/start"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"流程启动"
,
notes
=
"流程启动"
)
public
ResponseModel
<
String
>
start
()
throws
Exception
{
return
ResponseHelper
.
buildResponse
(
projectInitiationServiceImpl
.
start
(
new
Object
()));
projectInitiationServiceImpl
.
start
(
new
Project
());
return
ResponseHelper
.
buildResponse
(
"ok"
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
...
...
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/ProjectResourceController.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -113,4 +115,16 @@ public class ProjectResourceController extends BaseController {
public
ResponseModel
<
List
<
ProjectResourceDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
queryForProjectResourceList
());
}
/**
* 绑定设备跟项目
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"绑定设备跟项目"
,
notes
=
"绑定设备跟项目"
)
@PostMapping
(
value
=
"/saveId"
)
public
ResponseModel
<
ProjectResource
>
saveId
(
@RequestBody
JSONObject
jsonObject
)
{
return
ResponseHelper
.
buildResponse
(
projectResourceServiceImpl
.
saveIds
(
jsonObject
));
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/controller/WeldController.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
controller
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -90,7 +91,7 @@ public class WeldController extends BaseController {
}
/**
* 列表分页查询
* 列表分页查询
+条件查询
*
* @param current 当前页
* @param current 每页大小
...
...
@@ -100,8 +101,9 @@ public class WeldController extends BaseController {
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"焊口信息表分页查询"
,
notes
=
"焊口信息表分页查询"
)
public
ResponseModel
<
Page
<
WeldDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldPage
(
current
,
size
));
(
value
=
"size"
)
int
size
,
String
projectId
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
queryForWeldPage
(
current
,
size
,
projectId
));
}
/**
...
...
@@ -122,11 +124,11 @@ public class WeldController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"
POS
T"
,
value
=
"生成焊口编码"
,
notes
=
"生成焊口编码"
)
@
Pos
tMapping
(
value
=
"/getCode"
)
public
synchronized
ResponseModel
<
String
>
getCode
(
Long
sequenceNbr
,
int
number
)
throws
Exception
{
weldServiceImpl
.
getCode
(
sequenceNbr
,
number
);
return
ResponseHelper
.
buildResponse
(
"ok"
);
@ApiOperation
(
httpMethod
=
"
GE
T"
,
value
=
"生成焊口编码"
,
notes
=
"生成焊口编码"
)
@
Ge
tMapping
(
value
=
"/getCode"
)
public
ResponseModel
<
List
<
Weld
>>
getCode
(
Long
sequenceNbr
,
int
number
)
{
return
ResponseHelper
.
buildResponse
(
weldServiceImpl
.
getCode
(
sequenceNbr
,
number
)
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/EquipmentServiceImpl.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Equipment
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IEquipmentService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.EquipmentDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -16,18 +20,40 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
EquipmentServiceImpl
extends
BaseService
<
EquipmentDto
,
Equipment
,
EquipmentMapper
>
implements
IEquipmentService
{
public
class
EquipmentServiceImpl
extends
BaseService
<
EquipmentDto
,
Equipment
,
EquipmentMapper
>
implements
IEquipmentService
{
@Autowired
EquipmentMapper
equipmentMapper
;
/**
* 分页查询
*/
public
Page
<
EquipmentDto
>
queryForEquipmentPage
(
Page
<
EquipmentDto
>
page
)
{
public
Page
<
EquipmentDto
>
queryForEquipmentPage
(
Page
<
EquipmentDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
EquipmentDto
>
queryForEquipmentList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
EquipmentDto
>
queryForEquipmentList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 设备数据名称查询
*
* @return
*/
public
List
<
JSONObject
>
selectName
()
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
//查询所有设备数据
List
<
Equipment
>
equipment
=
equipmentMapper
.
selectList
(
null
);
for
(
Equipment
i
:
equipment
)
{
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"company_id"
,
i
.
getCompanyId
());
names
.
add
(
name
);
}
return
names
;
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/MaterialServiceImpl.java
View file @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
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.entity.Material
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.MaterialMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IMaterialService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.MaterialDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -16,18 +19,36 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
MaterialServiceImpl
extends
BaseService
<
MaterialDto
,
Material
,
MaterialMapper
>
implements
IMaterialService
{
public
class
MaterialServiceImpl
extends
BaseService
<
MaterialDto
,
Material
,
MaterialMapper
>
implements
IMaterialService
{
/**
* 分页查询
*/
public
Page
<
MaterialDto
>
queryForMaterialPage
(
Page
<
MaterialDto
>
page
)
{
public
Page
<
MaterialDto
>
queryForMaterialPage
(
Page
<
MaterialDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
MaterialDto
>
queryForMaterialList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
MaterialDto
>
queryForMaterialList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 获取材料名称跟企业id
*/
public
List
<
JSONObject
>
selectName
()
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
List
<
Material
>
materials
=
baseMapper
.
selectList
(
null
);
for
(
Material
i
:
materials
)
{
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"company_id"
,
i
.
getCompanyId
());
names
.
add
(
name
);
}
return
names
;
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/OrgServiceImpl.java
0 → 100644
View file @
1a36238c
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.metadata.IPage
;
import
com.google.common.collect.Lists
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormColumn
;
import
com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.enums.OrgPersonEnum
;
import
com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormColumnServiceImpl
;
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.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.component.cache.Redis
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.*
;
import
static
org
.
typroject
.
tyboot
.
component
.
cache
.
Redis
.
redisTemplate
;
@Service
public
class
OrgServiceImpl
{
@Autowired
OrgUsrServiceImpl
orgUsrServiceImpl
;
@Autowired
DynamicFormColumnServiceImpl
dynamicFormColumnServiceImpl
;
@Autowired
DynamicFormInstanceServiceImpl
alertFormValueServiceImpl
;
@Autowired
private
RedisUtils
redisUtils
;
/**
* 保存orgUsr信息和FormInstance实体信息
* @param jsonObject
* @param bizOrgType
* @return
*/
public
OrgUsrDto
dataHandling
(
JSONObject
jsonObject
,
String
bizOrgType
){
OrgUsr
orgUsr
=
saveOrgUsr
(
jsonObject
,
bizOrgType
);
//条件构造器 找出column表种 类型为(COMPANY 或 DEPARTMENT 或 PERSON)的列
LambdaQueryWrapper
<
DynamicFormColumn
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
DynamicFormColumn:
:
getGroupCode
,
bizOrgType
);
List
<
DynamicFormColumn
>
dynamicFormColumnList
=
dynamicFormColumnServiceImpl
.
list
(
wrapper
);
List
<
DynamicFormInstance
>
dynamicFormInstanceList
=
new
ArrayList
<>();
for
(
DynamicFormColumn
dynamicFormColumn
:
dynamicFormColumnList
)
{
//将column表的基本字段信息给instance表
DynamicFormInstance
dynamicFormInstance
=
new
DynamicFormInstance
();
BeanUtils
.
copyProperties
(
dynamicFormColumn
,
dynamicFormInstance
);
//通过字段名去拿到表单传来的值
dynamicFormInstance
.
setFieldValue
(
jsonObject
.
getString
(
dynamicFormInstance
.
getFieldCode
()));
dynamicFormInstance
.
setInstanceId
(
orgUsr
.
getSequenceNbr
());
dynamicFormInstanceList
.
add
(
dynamicFormInstance
);
}
alertFormValueServiceImpl
.
saveBatch
(
dynamicFormInstanceList
);
OrgUsrDto
orgUsrDto
=
new
OrgUsrDto
();
BeanUtils
.
copyProperties
(
orgUsr
,
orgUsrDto
);
orgUsrDto
.
setDynamicFormValue
(
dynamicFormInstanceList
);
return
orgUsrDto
;
}
/**
* 保存orgUsr表信息
* @param jsonObject
* @param bizOrgType
* @return
*/
public
OrgUsr
saveOrgUsr
(
JSONObject
jsonObject
,
String
bizOrgType
){
ReginParams
reginParams
=
getReginParams
();
OrgUsr
orgUsr
=
new
OrgUsr
();
orgUsr
.
setRecDate
(
new
Date
());
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
getme
().
getResult
();
orgUsr
.
setRecUserName
(
user
.
getRealName
());
orgUsr
.
setRecUserId
(
user
.
getUserId
());
orgUsr
.
setBizOrgName
(
jsonObject
.
getString
(
"name"
));
orgUsr
.
setBizOrgType
(
bizOrgType
);
if
(
OrgPersonEnum
.
公司
.
getKey
().
equals
(
bizOrgType
)){
orgUsr
.
setBizOrgCode
(
jsonObject
.
getString
(
"creditCode"
));
orgUsr
.
setAmosOrgId
(
jsonObject
.
getString
(
"amosOrgId"
));
orgUsr
.
setAmosOrgCode
(
jsonObject
.
getString
(
"amosOrgCode"
));
}
if
(
OrgPersonEnum
.
人员
.
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
()));
}
if
(
OrgPersonEnum
.
部门
.
getKey
().
equals
(
bizOrgType
))
{
}
//设置bizOrgCode
if
(
orgUsr
.
getParentId
()
!=
null
)
{
OrgUsr
parent
=
orgUsrServiceImpl
.
getById
(
orgUsr
.
getParentId
());
if
(
parent
!=
null
&&
ObjectUtils
.
isEmpty
(
orgUsr
.
getBizOrgCode
()))
{
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
OrgUsrServiceImpl
.
getOrgCodeStr
());
}
}
else
{
orgUsr
.
setBizOrgCode
(
OrgUsrServiceImpl
.
getOrgCodeStr
());
}
orgUsrServiceImpl
.
save
(
orgUsr
);
return
orgUsr
;
}
/**
* 用户单位信息redis获取
**/
public
ReginParams
getReginParams
()
{
return
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
}
}
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 @
1a36238c
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.Wrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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
;
...
...
@@ -14,6 +17,7 @@ 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.mapper.ProjectInitiationMapper
;
...
...
@@ -46,6 +50,12 @@ import java.util.*;
@Service
public
class
ProjectInitiationServiceImpl
extends
BaseService
<
ProjectInitiationDto
,
ProjectInitiation
,
ProjectInitiationMapper
>
implements
IProjectInitiationService
{
@Autowired
ProjectInitiationServiceImpl
projectInitiationService
;
@Autowired
WorkflowExcuteServiceImpl
workflowExcuteService
;
...
...
@@ -61,6 +71,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Autowired
SuperviseRuleServiceImpl
superviseRuleServiceImpl
;
@Autowired
ProjectServiceImpl
projectService
;
private
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectInitiationServiceImpl
.
class
);
@Value
(
"${params.work.flow.processDefinitionKey}"
)
...
...
@@ -70,8 +83,9 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
String
start
(
Object
objectd
)
{
public
void
start
(
Project
project
)
{
String
instanceId
=
null
;
//启动流程
try
{
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
processDefinitionKey
);
...
...
@@ -86,14 +100,17 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
e
.
printStackTrace
();
System
.
out
.
println
(
"流程启动失败:"
+
e
.
getMessage
());
}
//新增project表的流程id和流程状态
project
.
setInstanceId
(
instanceId
);
project
.
setStatus
(
getFlowTaskName
(
instanceId
));
projectService
.
updateById
(
project
);
//审核条件
String
option
=
"0"
;
if
(
true
)
{
option
=
"1"
;
}
//执行审核流程
execute
(
instanceId
,
objectd
,
option
);
return
instanceId
;
//执行项目立项流程
execute
(
instanceId
,
project
,
option
);
}
@Override
...
...
@@ -107,28 +124,23 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
JSONObject
dataObject
=
jsonObject
.
getJSONObject
(
"data"
);
projectInitiation
.
setTaskId
(
dataObject
.
getString
(
"id"
));
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
));
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResult
(
option
);
dto
.
setResultCode
(
"condition"
);
dto
.
setTaskId
(
projectInitiation
.
getTaskId
());
HashMap
<
String
,
Object
>
var
=
new
HashMap
<>();
var
.
put
(
"condition"
,
option
);
dto
.
setVariable
(
var
);
if
(
"平台审核"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
System
.
out
.
println
();
if
(
ProjectInitiationEnum
.
平台审核
.
getName
().
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(
true
)
{
option
=
"1"
;
}
}
if
(
"监检员审核"
.
equals
(
dataObject
.
getString
(
"name"
))){
if
(
ProjectInitiationEnum
.
监检员审核
.
getName
()
.
equals
(
dataObject
.
getString
(
"name"
))){
if
(
"1"
.
equals
(
option
)){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
}
}
if
(
"接受审查意见"
.
equals
(
dataObject
.
getString
(
"name"
))){
if
(
ProjectInitiationEnum
.
接受审查意见
.
getName
()
.
equals
(
dataObject
.
getString
(
"name"
))){
projectInitiation
.
setTaskName
(
dataObject
.
getString
(
"name"
)+
"(流程结束!)"
);
}
if
(
"告知申请"
.
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(
ProjectInitiationEnum
.
告知申请
.
getName
()
.
equals
(
dataObject
.
getString
(
"name"
)))
{
if
(!
ValidationUtil
.
isEmpty
(
objectd
))
{
//设置短信发送的基本参数
HashMap
<
String
,
String
>
smsParams
=
new
HashMap
();
...
...
@@ -166,11 +178,24 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
try
{
//组装信息
TaskResultDTO
dto
=
new
TaskResultDTO
();
dto
.
setResult
(
option
);
dto
.
setResultCode
(
"condition"
);
dto
.
setTaskId
(
projectInitiation
.
getTaskId
());
HashMap
<
String
,
Object
>
var
=
new
HashMap
<>();
var
.
put
(
"condition"
,
option
);
dto
.
setVariable
(
var
);
//执行流程
Workflow
.
taskClient
.
completeByTask
(
projectInitiation
.
getTaskId
(),
dto
);
//保存日志
this
.
save
(
projectInitiation
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
System
.
out
.
println
(
"任务完成失败:"
+
e
.
getMessage
());
}
finally
{
//更新project种的status字段,表示当前流程下一个执行的任务
updateProjectFlowStatus
(
instanceId
);
}
}
...
...
@@ -185,4 +210,25 @@ public class ProjectInitiationServiceImpl extends BaseService<ProjectInitiationD
}
return
smsRecordModel
;
}
/**
* 获取流程当前任务名称
* @param instanceId
* @return
*/
public
String
getFlowTaskName
(
String
instanceId
){
JSONObject
jsonObject
=
workflowFeignService
.
getTask
(
instanceId
);
if
(
ValidationUtil
.
isEmpty
(
jsonObject
))
{
return
""
;
}
return
jsonObject
.
getJSONObject
(
"data"
).
getString
(
"name"
);
}
public
void
updateProjectFlowStatus
(
String
instanceId
){
LambdaQueryWrapper
<
Project
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
Project:
:
getInstanceId
,
instanceId
);
Project
project
=
projectService
.
getOne
(
wrapper
);
project
.
setStatus
(
getFlowTaskName
(
instanceId
));
projectService
.
updateById
(
project
);
}
}
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/ProjectResourceServiceImpl.java
View file @
1a36238c
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.yeejoin.amos.boot.module.ugp.api.entity.ProjectResource
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.EquipmentMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectResourceMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProjectResourceService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectResourceDto
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
/**
...
...
@@ -16,18 +22,47 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
ProjectResourceServiceImpl
extends
BaseService
<
ProjectResourceDto
,
ProjectResource
,
ProjectResourceMapper
>
implements
IProjectResourceService
{
public
class
ProjectResourceServiceImpl
extends
BaseService
<
ProjectResourceDto
,
ProjectResource
,
ProjectResourceMapper
>
implements
IProjectResourceService
{
@Autowired
EquipmentMapper
equipmentMapper
;
@Autowired
ProjectResourceMapper
projectResourceMapper
;
/**
* 分页查询
*/
public
Page
<
ProjectResourceDto
>
queryForProjectResourcePage
(
Page
<
ProjectResourceDto
>
page
)
{
public
Page
<
ProjectResourceDto
>
queryForProjectResourcePage
(
Page
<
ProjectResourceDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
ProjectResourceDto
>
queryForProjectResourceList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
ProjectResourceDto
>
queryForProjectResourceList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 存储项目设备关系
*/
public
ProjectResource
saveIds
(
JSONObject
jsonObject
)
{
JSONArray
subForm
=
jsonObject
.
getJSONArray
(
"subForm"
);
ProjectResource
projectResource
=
new
ProjectResource
();
for
(
Object
json2
:
subForm
)
{
String
select
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
json2
)).
getString
(
"select"
);
String
type
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
json2
)).
getString
(
"type"
);
String
companyId
=
jsonObject
.
getString
(
"company_id"
);
projectResource
.
setProjectId
(
Long
.
valueOf
(
companyId
));
projectResource
.
setResourceId
(
Long
.
valueOf
(
select
));
projectResource
.
setType
(
type
);
this
.
save
(
projectResource
);
}
return
projectResource
;
}
}
\ No newline at end of file
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 @
1a36238c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
ugp
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IProjectService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.ProjectDto
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
...
...
@@ -16,18 +20,38 @@ import java.util.List;
* @date 2022-09-22
*/
@Service
public
class
ProjectServiceImpl
extends
BaseService
<
ProjectDto
,
Project
,
ProjectMapper
>
implements
IProjectService
{
public
class
ProjectServiceImpl
extends
BaseService
<
ProjectDto
,
Project
,
ProjectMapper
>
implements
IProjectService
{
@Autowired
ProjectMapper
projectMapper
;
/**
* 分页查询
*/
public
Page
<
ProjectDto
>
queryForProjectPage
(
Page
<
ProjectDto
>
page
)
{
public
Page
<
ProjectDto
>
queryForProjectPage
(
Page
<
ProjectDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
}
/**
* 列表查询 示例
*/
public
List
<
ProjectDto
>
queryForProjectList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
ProjectDto
>
queryForProjectList
()
{
return
this
.
queryForList
(
""
,
false
);
}
/**
* 查询项目名称
*/
public
List
<
JSONObject
>
selectName
()
{
List
<
JSONObject
>
names
=
new
ArrayList
<>();
//查询所有项目
List
<
Project
>
projects
=
projectMapper
.
selectList
(
null
);
for
(
Project
i
:
projects
)
{
JSONObject
name
=
new
JSONObject
();
name
.
put
(
"name"
,
i
.
getName
());
name
.
put
(
"company_id"
,
i
.
getCompanyId
());
names
.
add
(
name
);
}
return
names
;
}
}
\ No newline at end of file
amos-boot-system-ugp/amos-boot-module-ugp-biz/src/main/java/com/yeejoin/amos/boot/module/ugp/biz/service/impl/WeldServiceImpl.java
View file @
1a36238c
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.biz.common.entity.BaseEntity
;
import
com.
baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WeldCodeEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.Enum.WeldMethodEnum
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Project
;
import
com.yeejoin.amos.boot.module.ugp.api.entity.Weld
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.ProjectMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.mapper.WeldMapper
;
import
com.yeejoin.amos.boot.module.ugp.api.service.IWeldService
;
import
com.yeejoin.amos.boot.module.ugp.api.dto.WeldDto
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Pag
e
;
import
org.typroject.tyboot.core.rdbms.service.BaseServic
e
;
import
java.
text.ParseException
;
import
java.
text.SimpleDateFormat
;
import
java.util.
*
;
import
java.
util.ArrayList
;
import
java.
util.Date
;
import
java.util.
List
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
/**
* 焊口信息表服务实现类
...
...
@@ -42,14 +36,13 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
ProjectMapper
projectMapper
;
Logger
logger
=
LoggerFactory
.
getLogger
(
WeldServiceImpl
.
class
);
//
Logger logger = LoggerFactory.getLogger(WeldServiceImpl.class);
/**
* 分页查询
*/
public
Page
<
WeldDto
>
queryForWeldPage
(
int
current
,
int
size
)
{
public
Page
<
WeldDto
>
queryForWeldPage
(
int
current
,
int
size
,
String
projectId
)
{
Page
<
WeldDto
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
...
...
@@ -57,20 +50,28 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
for
(
WeldDto
weldDto
:
weldDtoPage
.
getRecords
())
{
QueryWrapper
<
Project
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"
code
"
,
weldDto
.
getProjectId
());
wrapper
.
eq
(
"
sequence_nbr
"
,
weldDto
.
getProjectId
());
Project
project
=
projectMapper
.
selectOne
(
wrapper
);
weldDto
.
setName
(
project
.
getName
());
QueryWrapper
<
Project
>
wrapperUnit
=
new
QueryWrapper
<>();
wrapperUnit
.
eq
(
"installation_unit_id"
,
weldDto
.
getInstallCompany
());
List
<
Project
>
projects
=
projectMapper
.
selectList
(
wrapperUnit
);
for
(
Project
project1
:
projects
)
{
weldDto
.
setInstallationUnit
(
project1
.
getInstallationUnit
());
weldDto
.
setCodingStatus
(
WeldCodeEnum
.
map
.
get
(
weldDto
.
getCodingStatus
()));
weldDto
.
setCodingMethod
(
WeldMethodEnum
.
map
.
get
(
weldDto
.
getCodingMethod
()));
}
}
if
(
projectId
==
null
)
{
return
weldDtoPage
;
}
else
{
List
<
WeldDto
>
L
=
weldDtoPage
.
getRecords
().
stream
().
filter
(
b
->
b
.
getProjectId
().
equals
(
projectId
)).
collect
(
Collectors
.
toList
());
weldDtoPage
.
setRecords
(
L
);
return
weldDtoPage
;
}
return
weldDtoPage
;
}
...
...
@@ -88,53 +89,45 @@ class WeldServiceImpl extends BaseService<WeldDto, Weld, WeldMapper> implements
private
static
final
AtomicInteger
atomicNum
=
new
AtomicInteger
();
// 初始化编号
private
final
int
INIT_CODE_NUM
=
0
;
private
final
String
FIRST_CHARACTER
=
"-HK"
;
public
synchronized
void
getCode
(
Long
sequenceNbr
,
int
number
)
throws
Exception
{
public
synchronized
List
<
Weld
>
getCode
(
Long
sequenceNbr
,
int
number
)
{
List
<
Weld
>
welds
=
new
ArrayList
<>();
Project
project
=
projectMapper
.
selectById
(
sequenceNbr
);
QueryWrapper
<
Weld
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
"project_id"
,
project
.
getCode
()
).
orderByDesc
(
"code"
).
last
(
"limit 1"
);
//根据seq查询条件判断是否已经存在该项目的该焊口编码
wrapper
.
eq
(
"project_id"
,
sequenceNbr
).
orderByDesc
(
"code"
).
last
(
"limit 1"
);
Weld
weld1
=
weldMapper
.
selectOne
(
wrapper
);
if
(
weld1
!=
null
)
{
String
substring
=
weld1
.
getCode
().
substring
(
13
,
17
);
//存在时取后四位
String
substring
=
weld1
.
getCode
().
substring
(
weld1
.
getCode
().
length
()
-
4
,
weld1
.
getCode
().
length
());
atomicNum
.
set
(
Integer
.
parseInt
(
substring
));
for
(
int
i
=
0
;
i
<
number
;
i
++)
{
Weld
weld
=
new
Weld
();
String
i1
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
String
code
=
"XM"
+
(
project
.
getCode
())
+
"-HK"
+
i1
;
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setProjectId
(
Long
.
valueOf
(
project
.
getCode
()));
weld
.
setInstallCompany
(
project
.
getInstallationUnitId
());
weld
.
setCode
(
code
);
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setCodingMethod
(
"0"
);
weld
.
setCodingStatus
(
"1"
);
weld
.
setCodingDate
(
new
Date
());
welds
.
add
(
weld
);
}
saveBatch
(
welds
);
}
else
{
atomicNum
.
set
(
0
);
for
(
int
i
=
0
;
i
<
number
;
i
++)
{
Weld
weld
=
new
Weld
();
String
i1
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
String
code
=
"XM"
+
(
project
.
getCode
())
+
"-HK"
+
i1
;
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setProjectId
(
Long
.
valueOf
(
project
.
getCode
()));
weld
.
setInstallCompany
(
project
.
getInstallationUnitId
());
weld
.
setCode
(
code
);
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setCodingMethod
(
"0"
);
weld
.
setCodingStatus
(
"1"
);
weld
.
setCodingDate
(
new
Date
());
welds
.
add
(
weld
);
}
saveBatch
(
welds
);
//不存在时将atomicNum初始化
atomicNum
.
set
(
INIT_CODE_NUM
);
}
for
(
int
i
=
0
;
i
<
number
;
i
++)
{
Weld
weld
=
new
Weld
();
//生成四位数
String
i1
=
String
.
format
(
"%04d"
,
atomicNum
.
incrementAndGet
());
//生成编码
String
code
=
(
project
.
getCode
())
+
FIRST_CHARACTER
+
i1
;
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setProjectId
(
Long
.
valueOf
(
project
.
getSequenceNbr
()));
weld
.
setInstallCompany
(
project
.
getInstallationUnitId
());
weld
.
setCode
(
code
);
weld
.
setRegion
(
project
.
getAddress
());
weld
.
setCodingMethod
(
WeldMethodEnum
.
赋码方式
1
.
getState
());
weld
.
setCodingStatus
(
WeldCodeEnum
.
赋值状态
2
.
getState
());
weld
.
setCodingDate
(
new
Date
());
welds
.
add
(
weld
);
}
saveBatch
(
welds
);
return
welds
;
}
}
\ 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