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
4704a8c3
Commit
4704a8c3
authored
Oct 18, 2021
by
chenhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加删除时的限制
parent
e127f546
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
67 additions
and
5 deletions
+67
-5
IDutyFireFightingService.java
...t/module/common/api/service/IDutyFireFightingService.java
+2
-0
DutyCarController.java
.../boot/module/common/biz/controller/DutyCarController.java
+7
-1
DutyFireFightingController.java
...ule/common/biz/controller/DutyFireFightingController.java
+18
-1
DutyFirstAidController.java
.../module/common/biz/controller/DutyFirstAidController.java
+7
-1
DutyPersonController.java
...ot/module/common/biz/controller/DutyPersonController.java
+7
-1
DutyFireFightingServiceImpl.java
.../common/biz/service/impl/DutyFireFightingServiceImpl.java
+26
-1
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/IDutyFireFightingService.java
View file @
4704a8c3
...
...
@@ -17,5 +17,7 @@ public interface IDutyFireFightingService extends IDutyCommonService {
* @return List<DutyCarDto>
*/
DutyFireFightingDto
update
(
Long
instanceId
,
DutyFireFightingDto
dto
);
Object
getlistDutyPostTypeName
(
Long
userId
);
}
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 @
4704a8c3
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.common.biz.controller;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyCarService
;
...
...
@@ -132,16 +133,21 @@ public class DutyCarController extends BaseController {
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
"/{instanceId}/{startTime}/{endTime}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"值班数据删除"
,
notes
=
"值班数据删除"
)
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
{
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
throws
Exception
{
if
(
ValidationUtil
.
isEmpty
(
instanceId
)
||
ValidationUtil
.
isEmpty
(
startTime
)
||
ValidationUtil
.
isEmpty
(
endTime
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
List
<
Map
<
String
,
Object
>>
list
=
iDutyCarService
.
list
(
null
,
startTime
,
DateUtils
.
getDateNowShortStr
());
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
throw
new
BadRequest
(
"班次已有值班数据,无法删除"
);
}
// BUG 2807 删除逻辑缺陷,现在前端后端传入 删除月份 2021-09-10 by kongfm
return
ResponseHelper
.
buildResponse
(
iDutyCarService
.
deleteDutyData
(
instanceId
,
startTime
,
endTime
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyFireFightingController.java
View file @
4704a8c3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
controller
;
import
java.text.ParseException
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -17,14 +18,18 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.foundation.utils.ValidationUtil
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
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
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService
;
...
...
@@ -136,16 +141,21 @@ public class DutyFireFightingController extends BaseController{
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
* @throws ParseException
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
"/{instanceId}/{startTime}/{endTime}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"值班数据删除"
,
notes
=
"值班数据删除"
)
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
{
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
throws
Exception
{
if
(
ValidationUtil
.
isEmpty
(
instanceId
)
||
ValidationUtil
.
isEmpty
(
startTime
)
||
ValidationUtil
.
isEmpty
(
endTime
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
List
<
Map
<
String
,
Object
>>
list
=
iDutyFireFightingService
.
list
(
null
,
startTime
,
DateUtils
.
getDateNowShortStr
());
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
throw
new
BadRequest
(
"班次已有值班数据,无法删除"
);
}
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
deleteDutyData
(
instanceId
,
startTime
,
endTime
));
}
...
...
@@ -157,4 +167,11 @@ public class DutyFireFightingController extends BaseController{
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
){
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
getSchedulingDutyForSpecifyDate
(
dutyDay
,
shiftId
,
postType
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"查询微型消防站排班值班的噶岗位信息列表"
)
@GetMapping
(
"/DutyPostTypeName/{userId}"
)
public
ResponseModel
getlistDutyPostTypeName
(
@ApiParam
(
value
=
"当前用户id"
,
required
=
true
)
@PathVariable
Long
userId
)
{
return
ResponseHelper
.
buildResponse
(
iDutyFireFightingService
.
getlistDutyPostTypeName
(
userId
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/controller/DutyFirstAidController.java
View file @
4704a8c3
...
...
@@ -25,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFirstAidDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFirstAidService
;
...
...
@@ -133,16 +134,21 @@ public class DutyFirstAidController extends BaseController{
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
"/{instanceId}/{startTime}/{endTime}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"值班数据删除"
,
notes
=
"值班数据删除"
)
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
{
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
throws
Exception
{
if
(
ValidationUtil
.
isEmpty
(
instanceId
)
||
ValidationUtil
.
isEmpty
(
startTime
)
||
ValidationUtil
.
isEmpty
(
endTime
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
List
<
Map
<
String
,
Object
>>
list
=
iDutyFirstAidService
.
list
(
null
,
startTime
,
DateUtils
.
getDateNowShortStr
());
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
throw
new
BadRequest
(
"班次已有值班数据,无法删除"
);
}
return
ResponseHelper
.
buildResponse
(
iDutyFirstAidService
.
deleteDutyData
(
instanceId
,
startTime
,
endTime
));
}
...
...
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 @
4704a8c3
...
...
@@ -25,6 +25,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyPersonService
;
...
...
@@ -130,16 +131,21 @@ public class DutyPersonController extends BaseController {
* @param startTime 开始时间
* @param endTime 结束时间
* @return ResponseModel
* @throws Exception
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
"/{instanceId}/{startTime}/{endTime}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"值班数据删除"
,
notes
=
"值班数据删除"
)
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
{
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
,
@PathVariable
String
startTime
,
@PathVariable
String
endTime
)
throws
Exception
{
if
(
ValidationUtil
.
isEmpty
(
instanceId
)
||
ValidationUtil
.
isEmpty
(
startTime
)
||
ValidationUtil
.
isEmpty
(
endTime
)){
throw
new
BadRequest
(
"参数校验失败."
);
}
List
<
Map
<
String
,
Object
>>
list
=
iDutyPersonService
.
list
(
null
,
startTime
,
DateUtils
.
getDateNowShortStr
());
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
throw
new
BadRequest
(
"班次已有值班数据,无法删除"
);
}
// BUG 2807 删除逻辑缺陷,现在前端后端传入 删除月份 2021-09-10 by kongfm
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
deleteDutyData
(
instanceId
,
startTime
,
endTime
));
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/impl/DutyFireFightingServiceImpl.java
View file @
4704a8c3
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
.
impl
;
import
static
org
.
hamcrest
.
CoreMatchers
.
nullValue
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -9,9 +12,12 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.ObjectUtils
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
com.itextpdf.text.pdf.PdfStructTreeController.returnType
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyFireFightingDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.FireStationDto
;
import
com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper
;
import
com.yeejoin.amos.boot.module.common.api.service.IDutyFireFightingService
;
...
...
@@ -25,6 +31,9 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
@Autowired
DutyPersonShiftMapper
dutyPersonShiftMapper
;
@Autowired
DynamicFormInstanceServiceImpl
alertFormValueServiceImpl
;
public
String
getGroupCode
()
{
return
"dutyFireFighting"
;
}
...
...
@@ -101,5 +110,21 @@ public class DutyFireFightingServiceImpl extends DutyCommonServiceImpl implement
}
return
detailList
;
}
@Override
public
Object
getlistDutyPostTypeName
(
Long
userId
)
{
List
<
DynamicFormInstanceDto
>
dyList
=
alertFormValueServiceImpl
.
queryByCalledId
(
userId
);
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
if
(
ObjectUtils
.
isEmpty
(
dyList
))
{
return
null
;
}
for
(
DynamicFormInstanceDto
dto
:
dyList
)
{
if
(
"positionType"
.
equals
(
dto
.
getFieldCode
()))
{
map
.
put
(
"postType"
,
dto
.
getFieldValue
());
map
.
put
(
"postTypeName"
,
dto
.
getFieldValueLabel
());
break
;
}
}
return
map
;
}
}
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