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
2ed750c3
Commit
2ed750c3
authored
Oct 27, 2022
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运维概览运维人员列表 接口 重写
parent
62bed114
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
94 additions
and
42 deletions
+94
-42
DynamicFormInstanceMapper.java
...t/module/common/api/mapper/DynamicFormInstanceMapper.java
+7
-0
IDutyCommonService.java
...os/boot/module/common/api/service/IDutyCommonService.java
+1
-1
DynamicFormInstanceMapper.xml
...i/src/main/resources/mapper/DynamicFormInstanceMapper.xml
+29
-1
DutyPersonController.java
...ot/module/common/biz/controller/DutyPersonController.java
+9
-1
DutyCommonServiceImpl.java
...module/common/biz/service/impl/DutyCommonServiceImpl.java
+31
-26
EquipmentServiceImpl.java
...eejoin/equipmanage/service/impl/EquipmentServiceImpl.java
+4
-1
EquipmentSpecificSerivceImpl.java
...quipmanage/service/impl/EquipmentSpecificSerivceImpl.java
+3
-3
FireFightingSystemServiceImpl.java
...uipmanage/service/impl/FireFightingSystemServiceImpl.java
+1
-1
EquipmentSpecificIndexMapper.xml
...rc/main/resources/mapper/EquipmentSpecificIndexMapper.xml
+2
-1
FireFightingSystemMapper.xml
...ip/src/main/resources/mapper/FireFightingSystemMapper.xml
+7
-7
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/mapper/DynamicFormInstanceMapper.java
View file @
2ed750c3
...
...
@@ -142,6 +142,13 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
List
<
Map
<
String
,
Object
>>
getOrgPersonTelphone
(
List
<
Map
<
String
,
Object
>>
companyIds
);
List
<
Map
<
String
,
Object
>>
personInfoList
(
String
groupCode
,
HashSet
<
String
>
userIdSet
);
/**
* 查询运维人员
* @param page
* @return
*/
Page
<
Map
<
String
,
Object
>>
getPersonInfoByPage
(
Page
page
,
@Param
(
"bizOrgCode"
)
String
bizOrgCode
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/java/com/yeejoin/amos/boot/module/common/api/service/IDutyCommonService.java
View file @
2ed750c3
...
...
@@ -32,7 +32,7 @@ public interface IDutyCommonService {
* @return
* @throws ParseException
*/
IPage
<
Map
<
String
,
Object
>>
pageListDetail
(
int
current
,
int
size
,
String
beginDate
,
String
endDate
)
throws
ParseException
;
IPage
<
Map
<
String
,
Object
>>
pageListDetail
(
int
current
,
int
size
,
String
beginDate
,
String
endDate
,
String
bizOrgCode
)
throws
ParseException
;
/**
* 值班明细
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DynamicFormInstanceMapper.xml
View file @
2ed750c3
...
...
@@ -594,5 +594,33 @@ WHERE
GROUP BY
i.instance_id
</select>
<select
id=
"getPersonInfoByPage"
resultType=
"java.util.Map"
>
SELECT
ou.sequence_nbr as id,
ou.biz_org_name as userName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'telephone' THEN field_value END ), '' ) AS telephone,
IFNULL( MAX( CASE WHEN cfi.field_code = 'postTypeName' THEN field_value END ), '' ) AS postTypeName,
IFNULL( MAX( CASE WHEN cfi.field_code = 'personImg' THEN field_value END ), '' ) AS personImg,
IFNULL( MAX( CASE WHEN cfi.field_code = 'peopleType' THEN field_value END ), '' ) AS peopleType
FROM
(
SELECT
IFNULL( max( CASE WHEN fi.field_code = 'userId' THEN fi.field_value END ), ps.instance_id ) AS id
FROM
cb_duty_person_shift ps
LEFT JOIN cb_dynamic_form_instance fi ON fi.instance_id = ps.instance_id
WHERE
ps.duty_date = CURRENT_DATE
GROUP BY
fi.instance_id
) a
LEFT JOIN cb_org_usr ou ON ou.sequence_nbr = a.id
LEFT JOIN cb_dynamic_form_instance cfi ON ou.sequence_nbr = cfi.instance_id
where ou.biz_org_code like concat(#{bizOrgCode}, '%')
GROUP BY
a.id
HAVING
peopleType = 1602
</select>
</mapper>
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyPersonController.java
View file @
2ed750c3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateFormatUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -68,7 +71,12 @@ public class DutyPersonController extends BaseController {
beginDate
=
date
;
endDate
=
date
;
}
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
pageListDetail
(
current
,
size
,
beginDate
,
endDate
));
ReginParams
selectedOrgInfo
=
getSelectedOrgInfo
();
String
bizOrgCode
=
ObjectUtils
.
isEmpty
(
selectedOrgInfo
)
||
ObjectUtils
.
isEmpty
(
selectedOrgInfo
.
getPersonIdentity
())
?
""
:
selectedOrgInfo
.
getPersonIdentity
().
getBizOrgCode
();
if
(
StringUtils
.
isEmpty
(
bizOrgCode
))
{
return
ResponseHelper
.
buildResponse
(
null
);
}
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
pageListDetail
(
current
,
size
,
beginDate
,
endDate
,
bizOrgCode
));
}
/**
...
...
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 @
2ed750c3
...
...
@@ -19,8 +19,10 @@ import java.util.stream.Stream;
import
javax.servlet.http.HttpServletRequest
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.entity.DataDictionary
;
import
com.yeejoin.amos.boot.biz.common.service.IDataDictionaryService
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper
;
import
com.yeejoin.amos.boot.module.common.biz.enums.DataDictionaryTypeEnum
;
import
com.yeejoin.amos.boot.module.common.biz.enums.DynamicGroupCodeEnum
;
import
org.apache.commons.collections4.CollectionUtils
;
...
...
@@ -88,6 +90,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
@Autowired
IDataDictionaryService
dataDictionaryService
;
@Autowired
DynamicFormInstanceMapper
dynamicFormInstanceMapper
;
/**
* 每天单个班次执勤人数全部小于等于3人
...
...
@@ -115,33 +119,34 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
}
@Override
public
IPage
<
Map
<
String
,
Object
>>
pageListDetail
(
int
current
,
int
size
,
String
beginDate
,
String
endDate
)
public
IPage
<
Map
<
String
,
Object
>>
pageListDetail
(
int
current
,
int
size
,
String
beginDate
,
String
endDate
,
String
bizOrgCode
)
throws
ParseException
{
// 1.已column为准 进行返回
String
groupCode
=
this
.
getGroupCode
();
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
IPage
<
Map
<
String
,
Object
>>
iPage
=
dynamicFormInstanceService
.
pageListNew
(
current
,
size
,
groupCode
,
beginDate
,
endDate
);
List
<
Map
<
String
,
Object
>>
records
=
iPage
.
getRecords
();
HashSet
<
String
>
userIdSet
=
new
HashSet
<>();
if
(!
CollectionUtils
.
isEmpty
(
records
))
{
records
.
forEach
(
x
->
{
userIdSet
.
add
(
x
.
get
(
"userId"
).
toString
());
});
}
// 获取人员详细信息
List
<
Map
<
String
,
Object
>>
personInfoList
=
dynamicFormInstanceService
.
personInfoList
(
DynamicGroupCodeEnum
.
JCS_PERSON
.
getCode
(),
userIdSet
);
if
(!
CollectionUtils
.
isEmpty
(
personInfoList
))
{
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
listMap
=
personInfoList
.
stream
().
collect
(
Collectors
.
groupingBy
((
Map
m
)
->
String
.
valueOf
(
m
.
get
(
"userId"
))));
records
.
forEach
(
x
->
{
String
userId
=
x
.
get
(
"userId"
).
toString
();
List
<
Map
<
String
,
Object
>>
list
=
listMap
.
get
(
userId
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
list
.
forEach
(
x:
:
putAll
);
}
});
iPage
.
setRecords
(
records
);
}
return
iPage
;
// // 1.已column为准 进行返回
// String groupCode = this.getGroupCode();
// // 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
// IPage<Map<String, Object>> iPage = dynamicFormInstanceService.pageListNew(current, size, groupCode, beginDate, endDate);
// List<Map<String, Object>> records = iPage.getRecords();
// HashSet<String> userIdSet = new HashSet<>();
// if (!CollectionUtils.isEmpty(records)) {
// records.forEach(x -> {
// userIdSet.add(x.get("userId").toString());
// });
// }
// // 获取人员详细信息
// List<Map<String, Object>> personInfoList = dynamicFormInstanceService.personInfoList(DynamicGroupCodeEnum.JCS_PERSON.getCode(), userIdSet);
// if (!CollectionUtils.isEmpty(personInfoList)) {
// Map<String, List<Map<String, Object>>> listMap = personInfoList.stream().collect(Collectors.groupingBy((Map m) -> String.valueOf(m.get("userId"))));
// records.forEach(x -> {
// String userId = x.get("userId").toString();
// List<Map<String, Object>> list = listMap.get(userId);
// if (!CollectionUtils.isEmpty(list)) {
// list.forEach(x::putAll);
// }
// });
// iPage.setRecords(records);
// }
// return iPage;
return
dynamicFormInstanceMapper
.
getPersonInfoByPage
(
new
Page
(
current
,
size
),
bizOrgCode
);
}
private
void
fillDutyShiftData
(
String
beginDate
,
String
endDate
,
Map
<
String
,
Object
>
m
)
throws
ParseException
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentServiceImpl.java
View file @
2ed750c3
...
...
@@ -220,7 +220,10 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
equipment1
.
setImg
(
""
);
}
int
savedEquipment
=
equipmentMapper
.
updateById
(
equipment1
);
iEquipmentDetailService
.
update
(
new
UpdateWrapper
<
EquipmentDetail
>().
eq
(
"equipment_id"
,
equipment1
.
getId
()).
set
(
"name"
,
equipment1
.
getName
()));
iEquipmentDetailService
.
update
(
new
UpdateWrapper
<
EquipmentDetail
>().
eq
(
"equipment_id"
,
equipment1
.
getId
())
.
set
(
"name"
,
equipment1
.
getName
())
.
set
(
"expiry_date"
,
equipment1
.
getExpiryDate
())
.
set
(
"maintenance_cycle"
,
equipment1
.
getMaintenanceCycle
()));
JSONObject
equipRuleParams
=
new
JSONObject
();
equipRuleParams
.
put
(
"name"
,
equipment1
.
getName
());
equipRuleParams
.
put
(
"inspectionSpecId"
,
equipment1
.
getInspectionSpec
());
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/EquipmentSpecificSerivceImpl.java
View file @
2ed750c3
...
...
@@ -1828,8 +1828,8 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
List
<
Map
<
String
,
Object
>>
equipSpecificScrap
=
equipmentSpecificIndexMapper
.
getEquipSpecificScrap
();
equipSpecificScrap
.
forEach
(
e
->{
try
{
if
(
e
.
get
(
"we
s
Expiry"
)
!=
null
)
{
int
year
=
Integer
.
parseInt
(
e
.
get
(
"we
s
Expiry"
).
toString
());
if
(
e
.
get
(
"weExpiry"
)
!=
null
)
{
int
year
=
Integer
.
parseInt
(
e
.
get
(
"weExpiry"
).
toString
());
Date
productDate
=
DateUtils
.
dateParse
(
e
.
get
(
"product"
).
toString
(),
"yyyy-MM-dd'T'HH:mm"
);
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
productDate
);
...
...
@@ -1857,7 +1857,7 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
model
.
setTitle
(
"报废到期提醒"
);
String
equipName
=
map
.
get
(
"name"
).
toString
();
String
location
=
map
.
get
(
"
sname"
).
toString
()
+
map
.
get
(
"position"
).
toString
()
;
String
location
=
map
.
get
(
"
position"
).
toString
()
+
map
.
get
(
"area"
).
toString
()
;
String
body
=
String
.
format
(
"%s-%s于%s报废,请提前更换处理"
,
equipName
,
location
,
scrapTime
);
String
join
=
String
.
format
(
"设备还剩%s天报废,请提前更换"
,
i
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/FireFightingSystemServiceImpl.java
View file @
2ed750c3
...
...
@@ -2003,7 +2003,7 @@ public class FireFightingSystemServiceImpl extends ServiceImpl<FireFightingSyste
@Override
public
List
<
Map
<
String
,
Object
>>
getEquipExpiryStatistics
(
String
bizOrgCode
,
Integer
expiryDayNum
)
{
List
<
Map
<
String
,
Object
>>
equipExpiryStatistics
=
fireFightingSystemMapper
.
getEquipExpiryStatistics
(
bizOrgCode
,
expiryDayNum
);
equipExpiryStatistics
.
stream
().
forEach
(
item
->
{
equipExpiryStatistics
.
forEach
(
item
->
{
item
.
put
(
"value"
,
Integer
.
parseInt
(
item
.
get
(
"value"
).
toString
()));
});
return
equipExpiryStatistics
;
...
...
amos-boot-system-equip/src/main/resources/mapper/EquipmentSpecificIndexMapper.xml
View file @
2ed750c3
...
...
@@ -472,7 +472,8 @@
wes.position,
wes.name,
we.expiry_date as weExpiry,
wed.expiry_date as wesExpiry,
<!-- wed.expiry_date as wesExpiry,-->
wed.area as area,
wed.production_date as product
from wl_equipment_specific wes
left join wl_equipment_detail wed on wes.equipment_detail_id = wed.id
...
...
amos-boot-system-equip/src/main/resources/mapper/FireFightingSystemMapper.xml
View file @
2ed750c3
...
...
@@ -5065,10 +5065,10 @@
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND
sd.`status` != 7
AND
( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0
<!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0-->
AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) a
GROUP BY
...
...
@@ -5094,10 +5094,10 @@
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND
sd.`status` != 7
AND
( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL
AND es.biz_org_code like concat(#{bizOrgCode}, '%')
AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0
<!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0-->
AND #{expiryDayNum} >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
ORDER BY DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) ASC
</select>
...
...
@@ -5143,7 +5143,7 @@
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND
sd.`status` != 7
AND
( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND 0 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
...
...
@@ -5161,10 +5161,10 @@
LEFT JOIN wl_stock_detail sd ON sd.equipment_detail_id = ed.id
WHERE
ed.production_date IS NOT NULL
AND
sd.`status` != 7
AND
( (sd.`status` != 7) or (sd.`status` is null) or (sd.`status` = ''))
AND e.expiry_date IS NOT NULL
AND es.biz_org_code LIKE concat(#{bizOrgCode}, '%')
AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0
<!-- AND DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE ) > 0-->
AND 60 >= DATEDIFF( DATE_ADD( DATE_FORMAT( ed.production_date, '%Y-%m-%d' ), INTERVAL e.expiry_date YEAR ), CURRENT_DATE )
) AS countNum
</select>
...
...
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