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
bf981480
Commit
bf981480
authored
Feb 21, 2022
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完成需求bug :4803
parent
98a03eff
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
103 additions
and
70 deletions
+103
-70
IDutyCarService.java
.../amos/boot/module/common/api/service/IDutyCarService.java
+2
-0
DutyCarController.java
.../boot/module/common/biz/controller/DutyCarController.java
+7
-0
DutyCarServiceImpl.java
...ot/module/common/biz/service/impl/DutyCarServiceImpl.java
+19
-1
ExcelController.java
.../amos/boot/module/jcs/biz/controller/ExcelController.java
+17
-15
PowerTransferServiceImpl.java
...module/jcs/biz/service/impl/PowerTransferServiceImpl.java
+58
-54
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/service/IDutyCarService.java
View file @
bf981480
...
...
@@ -34,4 +34,6 @@ public interface IDutyCarService extends IDutyCommonService {
JSONObject
isFireCarDriver
();
int
getDutyCarCount
(
Long
carId
);
List
<
Map
<
String
,
Object
>>
getDutyCaruser
(
Long
carId
);
List
<
Map
<
String
,
Object
>>
theCarDutyPerson
(
Long
carId
);
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyCarController.java
View file @
bf981480
...
...
@@ -178,4 +178,10 @@ public class DutyCarController extends BaseController {
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
){
return
ResponseHelper
.
buildResponse
(
iDutyCarService
.
getSchedulingDutyForSpecifyDate
(
dutyDay
,
shiftId
,
postType
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"查询指定車輛值班人信息列表"
)
@GetMapping
(
"/theCar/personList"
)
public
ResponseModel
<
List
<
Map
<
String
,
Object
>>>
theCarDutyPerson
(
@RequestParam
Long
carId
){
return
ResponseHelper
.
buildResponse
(
iDutyCarService
.
theCarDutyPerson
(
carId
));
}
}
\ No newline at end of file
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyCarServiceImpl.java
View file @
bf981480
...
...
@@ -37,7 +37,7 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
DynamicFormInstanceServiceImpl
dynamicFormInstanceService
;
@Autowired
FirefightersMapper
firefightersMapper
;
FirefightersMapper
firefightersMapper
;
@Autowired
EquipFeignClient
equipFeignClient
;
...
...
@@ -233,4 +233,22 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
return
equipmentList
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
theCarDutyPerson
(
Long
carId
)
{
List
<
Map
<
String
,
Object
>>
specifyDateList
=
null
;
String
dutyDay
=
DateUtils
.
getDateNowShortStr
();
Map
<
String
,
Object
>
instanceMap
=
dutyPersonShiftMapper
.
getInstanceIdForSpecifyDateAndEquipment
(
dutyDay
,
this
.
getGroupCode
(),
carId
.
toString
());
if
(
instanceMap
==
null
)
{
return
null
;
}
String
instanceId
=
instanceMap
.
get
(
"instanceIds"
).
toString
();
if
(
StringUtils
.
isNotBlank
(
instanceId
))
{
String
[]
instanceIds
=
instanceId
.
split
(
","
);
specifyDateList
=
dutyPersonShiftMapper
.
getPositionStaffDutyForSpecifyDate
(
dutyDay
,
this
.
getGroupCode
(),
instanceIds
,
null
);
}
return
specifyDateList
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/controller/ExcelController.java
View file @
bf981480
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jcs
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.json.JSONObject
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
...
@@ -26,9 +20,17 @@ import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.PostConstruct
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Map
;
import
com.baomidou.mybatisplus.core.toolkit.Sequence
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.ExcelDto
;
import
com.yeejoin.amos.boot.module.jcs.api.enums.ExcelEnums
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.DataSourcesImpl
;
import
com.yeejoin.amos.boot.module.jcs.biz.service.impl.ExcelServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
/**
* 导出导入
...
...
@@ -67,7 +69,7 @@ public class ExcelController extends BaseController {
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"下载模板"
)
@GetMapping
(
"/download/template/{type}"
)
public
void
downloadTemplate
(
HttpServletResponse
response
,
@PathVariable
(
value
=
"type"
)
String
type
)
{
...
...
@@ -92,7 +94,7 @@ public class ExcelController extends BaseController {
* date 2021/9/13
* </PRE>
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
needAuth
=
false
,
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
value
=
"导出公用类"
)
@GetMapping
(
"/export/{type}"
)
public
void
getFireStationFile
(
HttpServletResponse
response
,
@PathVariable
(
value
=
"type"
)
String
type
,
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-jcs-biz/src/main/java/com/yeejoin/amos/boot/module/jcs/biz/service/impl/PowerTransferServiceImpl.java
View file @
bf981480
...
...
@@ -303,13 +303,16 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
if
(
specifyDateList
==
null
||
specifyDateList
.
size
()
<
1
||
specifyDateList
.
get
(
0
)
==
null
)
{
continue
;
}
int
num
=
0
;
LinkedHashMap
<
String
,
String
>
infoMap_1
=
new
LinkedHashMap
<
String
,
String
>();
for
(
Map
<
String
,
Object
>
specify
:
specifyDateList
)
{
//
if
(
specify
.
containsKey
(
"userName"
)
&&
specify
.
get
(
"userName"
)
!=
null
)
{
if
(
specify
.
get
(
"userName"
).
toString
().
contains
(
","
))
{
String
[]
userNames
=
specify
.
get
(
"userName"
).
toString
().
split
(
","
);
num
=
num
+
userNames
.
length
;
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
userNames
.
length
+
""
);
}
else
{
infoMap_1
.
put
(
dutyDetail
.
get
(
"name"
).
toString
(),
"1"
);
...
...
@@ -317,65 +320,66 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
resultList
.
add
(
infoMap_1
);
}
}
fireCarDto
.
setPersonCount
(
num
);
}
}
}
}
int
num
=
0
;
String
todayTime
=
DateUtils
.
getDateNowShortStr
();
String
beginDate
=
todayTime
;
beginDate
=
beginDate
+
" 00:00:00"
;
String
endDate
=
todayTime
;
endDate
=
endDate
+
" 23:59:59"
;
LambdaQueryWrapper
<
DutyShift
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BaseEntity:
:
getIsDelete
,
false
);
List
<
DutyShift
>
dutyShifts
=
dutyShiftMapper
.
selectList
(
wrapper
);
String
[]
dutyShiftName
=
{
" "
};
dutyShifts
.
forEach
(
e
->
{
String
startTime
=
e
.
getStartTime
();
Date
startDate
=
null
;
Date
dateEnd
=
null
;
if
(
startTime
.
startsWith
(
"当日:"
))
{
String
resultTime
=
startTime
.
replace
(
"当日:"
,
todayTime
)
+
":00"
;
startDate
=
DateUtils
.
longStr2Date
(
resultTime
);
}
else
if
(
startTime
.
startsWith
(
"次日:"
))
{
Date
dateNow
=
DateUtils
.
getDateNow
();
Date
date
=
DateUtils
.
dateAddDays
(
dateNow
,
1
);
String
s
=
DateUtils
.
convertDateToString
(
date
,
DateUtils
.
DATE_PATTERN
);
String
resultTime
=
startTime
.
replace
(
"次日:"
,
s
)
+
":00"
;
startDate
=
DateUtils
.
longStr2Date
(
resultTime
);
}
String
endTime
=
e
.
getEndTime
();
if
(
endTime
.
startsWith
(
"当日:"
))
{
String
resultTime
=
endTime
.
replace
(
"当日:"
,
todayTime
)
+
":00"
;
dateEnd
=
DateUtils
.
longStr2Date
(
resultTime
);
}
else
if
(
endTime
.
startsWith
(
"次日:"
))
{
Date
dateNow
=
DateUtils
.
getDateNow
();
Date
date
=
DateUtils
.
dateAddDays
(
dateNow
,
1
);
String
s
=
DateUtils
.
convertDateToString
(
date
,
DateUtils
.
DATE_PATTERN
);
String
resultTime
=
endTime
.
replace
(
"次日:"
,
s
)
+
":00"
;
dateEnd
=
DateUtils
.
longStr2Date
(
resultTime
);
}
if
(
DateUtils
.
belongCalendar
(
DateUtils
.
getDateNow
(),
startDate
,
dateEnd
))
{
dutyShiftName
[
0
]
=
dutyShiftName
[
0
].
replace
(
" "
,
e
.
getName
());
}
});
if
(
resultList
!=
null
)
{
resultList
.
forEach
(
e
->
{
if
(
e
.
containsKey
(
dutyShiftName
[
0
]))
{
String
personNum
=
e
.
get
(
dutyShiftName
[
0
]);
fireCarDto
.
setPersonCount
(
Integer
.
valueOf
(
personNum
));
}
});
}
else
{
fireCarDto
.
setPersonCount
(
num
);
}
//
int num = 0;
//
String todayTime = DateUtils.getDateNowShortStr();
//
String beginDate = todayTime;
//
beginDate = beginDate + " 00:00:00";
//
String endDate = todayTime;
//
endDate = endDate + " 23:59:59";
//
LambdaQueryWrapper<DutyShift> wrapper = new LambdaQueryWrapper<>();
//
wrapper.eq(BaseEntity::getIsDelete, false);
//
List<DutyShift> dutyShifts = dutyShiftMapper.selectList(wrapper);
//
//
String[] dutyShiftName = {" "};
//
//
dutyShifts.forEach(e -> {
//
String startTime = e.getStartTime();
//
Date startDate = null;
//
Date dateEnd = null;
//
if (startTime.startsWith("当日:")) {
//
String resultTime = startTime.replace("当日:", todayTime) + ":00";
//
startDate = DateUtils.longStr2Date(resultTime);
//
} else if (startTime.startsWith("次日:")) {
//
Date dateNow = DateUtils.getDateNow();
//
Date date = DateUtils.dateAddDays(dateNow, 1);
//
String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN);
//
String resultTime = startTime.replace("次日:", s) + ":00";
//
startDate = DateUtils.longStr2Date(resultTime);
//
}
//
String endTime = e.getEndTime();
//
if (endTime.startsWith("当日:")) {
//
String resultTime = endTime.replace("当日:", todayTime) + ":00";
//
dateEnd = DateUtils.longStr2Date(resultTime);
//
} else if (endTime.startsWith("次日:")) {
//
Date dateNow = DateUtils.getDateNow();
//
Date date = DateUtils.dateAddDays(dateNow, 1);
//
String s = DateUtils.convertDateToString(date, DateUtils.DATE_PATTERN);
//
String resultTime = endTime.replace("次日:", s) + ":00";
//
dateEnd = DateUtils.longStr2Date(resultTime);
//
}
//
//
if (DateUtils.belongCalendar(DateUtils.getDateNow(), startDate, dateEnd)) {
//
dutyShiftName[0] = dutyShiftName[0].replace(" ", e.getName());
//
}
//
});
//
//
if (resultList != null) {
//
resultList.forEach(e -> {
//
if (e.containsKey(dutyShiftName[0])) {
//
String personNum = e.get(dutyShiftName[0]);
//
fireCarDto.setPersonCount(Integer.valueOf(personNum));
//
}
//
});
//
} else {
//
fireCarDto.setPersonCount(num);
//
}
}
fireCarDtoList
.
add
(
fireCarDto
);
...
...
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