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
4514aac2
Commit
4514aac2
authored
Sep 10, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'chenhao' into developer
parents
52f5e5b9
bee39c63
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
81 additions
and
46 deletions
+81
-46
DutyPersonShiftMapper.xml
...n-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
+1
-1
OrgPersonController.java
...oot/module/common/biz/controller/OrgPersonController.java
+1
-1
OrgUsrController.java
...s/boot/module/common/biz/controller/OrgUsrController.java
+5
-1
WaterResourceController.java
...module/common/biz/controller/WaterResourceController.java
+0
-3
DutyCommonServiceImpl.java
...module/common/biz/service/impl/DutyCommonServiceImpl.java
+31
-0
OrgUsrServiceImpl.java
...oot/module/common/biz/service/impl/OrgUsrServiceImpl.java
+43
-40
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DutyPersonShiftMapper.xml
View file @
4514aac2
...
...
@@ -19,7 +19,7 @@
and s.duty_date >= #{beginDate}
and s.duty_date
<![CDATA[<=]]>
#{endDate}
and s.app_Key = #{appKey}
GROUP BY s.duty_date
GROUP BY s.duty_date
,s.shift_id
<!--增添分组条件 根据班次分组技术 -->
) a) as maxDutyPersonNumDay,
(select
IFNULL(max(num),0)
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgPersonController.java
View file @
4514aac2
...
...
@@ -79,7 +79,7 @@ public class OrgPersonController {
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgPersonDto
OrgPersonVo
,
@PathVariable
Long
id
)
throws
Exception
{
//
OrgPersonVo.setBizOrgType(CommonConstant.BIZ_ORG_TYPE_PERSON);
OrgPersonVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_PERSON
);
iOrgUsrService
.
updateByIdOrgPerson
(
OrgPersonVo
,
id
);
return
ResponseHelper
.
buildResponse
(
null
);
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/OrgUsrController.java
View file @
4514aac2
...
...
@@ -87,7 +87,10 @@ public class OrgUsrController extends BaseController {
return
ResponseHelper
.
buildResponse
(
"-1"
);
}
}
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
id
).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
// iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 开始*/
iOrgUsrService
.
update
(
new
UpdateWrapper
<
OrgUsr
>().
eq
(
"sequence_nbr"
,
String
.
valueOf
(
id
)).
set
(
"is_delete"
,
CommonConstant
.
IS_DELETE_01
));
/*bug 2812 一次删除多条数据 传入类型修改为string 问题解决 2021-09-09 陈召 结束*/
try
{
eSOrgUsrService
.
deleteById
(
id
);
emqKeeper
.
getMqttClient
().
publish
(
airportDeleteTopic
,
JSON
.
toJSONString
(
id
).
getBytes
(),
2
,
false
);
...
...
@@ -108,6 +111,7 @@ public class OrgUsrController extends BaseController {
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
PUT
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"更新单位数据"
,
notes
=
"更新单位数据"
)
public
ResponseModel
<?>
updateByIdOrgUsr
(
HttpServletRequest
request
,
@RequestBody
OrgUsrDto
OrgUsrVo
,
@PathVariable
Long
id
)
throws
Exception
{
OrgUsrVo
.
setBizOrgType
(
CommonConstant
.
BIZ_ORG_TYPE_COMPANY
);
iOrgUsrService
.
updateByIdOrgUsr
(
OrgUsrVo
,
id
);
return
ResponseHelper
.
buildResponse
(
null
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/WaterResourceController.java
View file @
4514aac2
...
...
@@ -100,7 +100,6 @@ public class WaterResourceController extends BaseController {
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}*/
if
(!
StringUtils
.
isEmpty
(
resourceType
))
{
switch
(
resourceType
)
{
case
"hydrant"
:
...
...
@@ -176,8 +175,6 @@ public class WaterResourceController extends BaseController {
model.setLongitude(Double.valueOf(address.getString(BizConstant.LONGITUDE)));
model.setLatitude(Double.valueOf(address.getString(BizConstant.LATITUDE)));
}*/
// 更新基本信息
model
.
setSequenceNbr
(
sequenceNbr
);
model
.
setRealityImg
(
JSONArray
.
toJSONString
(
model
.
getRealityImgList
()));
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCommonServiceImpl.java
View file @
4514aac2
...
...
@@ -85,16 +85,43 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
private
void
fillDutyShiftData
(
String
beginDate
,
String
endDate
,
Map
<
String
,
Object
>
m
)
throws
ParseException
{
// 获取值班的实例id
String
instanceId
=
m
.
get
(
"instanceId"
).
toString
();
// 根据appkey 获取未删除的值班班次
List
<
DutyShift
>
dutyShifts
=
dutyShiftService
.
list
(
new
LambdaQueryWrapper
<
DutyShift
>()
.
eq
(
BaseEntity:
:
getIsDelete
,
false
).
eq
(
DutyShift:
:
getAppKey
,
RequestContext
.
getAppKey
()));
// 根据id 保存成key -value
Map
<
Long
,
DutyShift
>
keyNameMap
=
dutyShifts
.
stream
()
.
collect
(
Collectors
.
toMap
(
BaseEntity:
:
getSequenceNbr
,
Function
.
identity
()));
// 根据时间 查询值班关系表
// BUG 2806 获取月份第一天和最后一天 2021-09-09 by kongfm
if
(
beginDate
!=
null
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
DateUtils
.
longStr2Date
(
beginDate
));
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
c
.
set
(
Calendar
.
MINUTE
,
0
);
c
.
set
(
Calendar
.
SECOND
,
0
);
beginDate
=
DateUtils
.
date2LongStr
(
c
.
getTime
());
}
if
(
endDate
!=
null
)
{
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
DateUtils
.
longStr2Date
(
beginDate
));
c
.
add
(
Calendar
.
MONTH
,
1
);
c
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
c
.
add
(
Calendar
.
DATE
,
-
1
);
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
23
);
c
.
set
(
Calendar
.
MINUTE
,
59
);
c
.
set
(
Calendar
.
SECOND
,
59
);
endDate
=
DateUtils
.
date2LongStr
(
c
.
getTime
());
}
List
<
DutyPersonShiftDto
>
personShiftList
=
dutyPersonShiftService
.
list
(
new
LambdaQueryWrapper
<
DutyPersonShift
>().
eq
(
DutyPersonShift:
:
getInstanceId
,
instanceId
)
.
ge
(
beginDate
!=
null
,
DutyPersonShift:
:
getDutyDate
,
beginDate
)
.
le
(
endDate
!=
null
,
DutyPersonShift:
:
getDutyDate
,
endDate
))
.
stream
().
map
(
e
->
{
// 值班关系查询到以后 重新封装
DutyPersonShiftDto
dto
=
new
DutyPersonShiftDto
();
Bean
.
copyExistPropertis
(
e
,
dto
);
// 没值班信息,默认休
...
...
@@ -152,6 +179,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
public
List
<
Map
<
String
,
Object
>>
list
(
Long
teamId
,
String
beginDate
,
String
endDate
)
throws
ParseException
{
// 1.已column为准 进行返回
String
groupCode
=
this
.
getGroupCode
();
// 动态表单查询所有值班信息
List
<
Map
<
String
,
Object
>>
list
=
dynamicFormInstanceService
.
listAll
(
groupCode
);
// 2.组织值班数据
...
...
@@ -299,6 +327,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Override
public
Boolean
deleteDutyData
(
Long
instanceId
)
{
// 一个人共用一个 instanceId
dynamicFormInstanceService
.
remove
(
new
LambdaQueryWrapper
<
DynamicFormInstance
>().
eq
(
DynamicFormInstance:
:
getInstanceId
,
instanceId
));
dutyPersonShiftService
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/OrgUsrServiceImpl.java
View file @
4514aac2
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.constants.CommonConstant
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.TreeParser
;
import
com.yeejoin.amos.boot.module.common.api.dto.*
;
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.MaintenanceCompany
;
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.api.enums.UserRolesEnum
;
import
com.yeejoin.amos.boot.module.common.api.enums.UserUnitTypeEnum
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
java.lang.reflect.Method
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
javax.annotation.Resource
;
import
java.lang.reflect.Method
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.OrgUsrDto
;
import
com.yeejoin.amos.boot.module.common.api.entity.OrgUsr
;
import
com.yeejoin.amos.boot.module.common.api.mapper.OrgUsrMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService
;
import
com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService
;
/**
* 机构/部门/人员表 服务实现类
...
...
@@ -239,7 +223,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
childList
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
returnCompanyPersonMsg
(
List
<
Long
>
ids
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
companyPersonMsg
=
new
ArrayList
<>();
...
...
@@ -621,6 +605,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgUsrVo
,
orgUsr
);
/*单位编辑后 code值也应做出修改 2021-09-09 陈召 开始 */
OrgUsr
parent
=
getById
(
OrgUsrVo
.
getParentId
());
if
(
parent
!=
null
){
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
orgUsr
.
setSequenceNbr
(
id
);
/*单位编辑后 code值也应做出修改 2021-09-09 陈召 结束 */
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgUsrVo
.
getDynamicFormValue
());
...
...
@@ -636,13 +627,13 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgPersonVo
,
orgUsr
);
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
OrgUsr
parent
=
getById
(
OrgPersonVo
.
getParentId
());
if
(
parent
!=
null
){
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 结束*/
orgUsr
.
setSequenceNbr
(
id
);
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 开始*/
OrgUsr
parent
=
getById
(
OrgPersonVo
.
getParentId
());
if
(!
ObjectUtils
.
isEmpty
(
parent
)){
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
/* Bug 2647 编辑用户所属单位后按单位筛选人员结果错误 增加了 638 639 两行代码 根据修改的部门调整部门code 2021-09-03 陈召 结束*/
if
(!
ObjectUtils
.
isEmpty
(
OrgPersonVo
.
getAmosOrgId
()))
{
AgencyUserModel
user
=
Privilege
.
agencyUserClient
.
queryByUserId
(
OrgPersonVo
.
getAmosOrgId
()).
getResult
();
oriOrgUsr
.
setAmosOrgCode
(
user
.
getRealName
());
...
...
@@ -776,6 +767,14 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
OrgUsr
orgUsr
=
new
OrgUsr
();
OrgUsr
oriOrgUsr
=
getById
(
id
);
BeanUtils
.
copyProperties
(
OrgDepartmentVo
,
orgUsr
);
/*部门编辑后 code值也应做出修改 2021-09-09 陈召 开始 */
OrgUsr
parent
=
getById
(
OrgDepartmentVo
.
getParentId
());
if
(
parent
!=
null
){
orgUsr
.
setBizOrgCode
(
parent
.
getBizOrgCode
()
+
getOrgCodeStr
());
}
orgUsr
.
setSequenceNbr
(
id
);
/*部门编辑后 code值也应做出修改 2021-09-09 陈召 结束 */
saveOrgUsr
(
orgUsr
,
oriOrgUsr
);
// 保存动态表单数据
updateDynamicFormInstance
(
orgUsr
.
getSequenceNbr
(),
OrgDepartmentVo
.
getDynamicFormValue
());
...
...
@@ -961,7 +960,8 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return
null
;
}
return
ids
.
stream
().
map
(
m
->
{
OrgUsr
org
=
getById
(
m
);
// BUG 2740 机场单位主键varchar 导致 通过主键搜索返回多条数据 2021 - 09 - 09by kongfm
OrgUsr
org
=
getById
(
m
.
toString
());
if
(
ObjectUtils
.
isEmpty
(
org
))
{
return
null
;
}
...
...
@@ -977,6 +977,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// BUG 2736 人员导出过滤已经删除的数据by kongfm
public
List
<
OrgUsrDto
>
queryForListByParentIdAndOrgType
(
Long
parentId
,
String
bizOrgType
,
Boolean
isDelete
)
{
return
this
.
queryForList
(
null
,
false
,
parentId
,
bizOrgType
,
isDelete
);
public
List
<
OrgUsrDto
>
queryForListByParentIdAndOrgType
(
Long
parentId
,
String
bizOrgType
)
{
return
Bean
.
toModels
(
this
.
list
(
new
LambdaQueryWrapper
<
OrgUsr
>().
eq
(
OrgUsr:
:
getIsDelete
,
false
).
eq
(
OrgUsr:
:
getParentId
,
parentId
).
eq
(
OrgUsr:
:
getBizOrgType
,
bizOrgType
)),
this
.
getModelClass
());
}
public
OrgUsrDto
getOrg
(
String
amosUserId
)
{
...
...
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