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
3e3a8108
Commit
3e3a8108
authored
Jul 12, 2021
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.新增接口
parent
32bdcf26
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
109 additions
and
8 deletions
+109
-8
DynamicFormInstanceMapper.java
...t/module/common/api/mapper/DynamicFormInstanceMapper.java
+24
-6
DynamicFormInstanceMapper.xml
...i/src/main/resources/mapper/DynamicFormInstanceMapper.xml
+43
-0
DutyCarController.java
.../boot/module/common/biz/controller/DutyCarController.java
+9
-0
DutyPersonController.java
...ot/module/common/biz/controller/DutyPersonController.java
+9
-1
IDutyCommonService.java
...os/boot/module/common/biz/service/IDutyCommonService.java
+10
-0
DutyCommonServiceImpl.java
...module/common/biz/service/impl/DutyCommonServiceImpl.java
+14
-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/mapper/DynamicFormInstanceMapper.java
View file @
3e3a8108
...
...
@@ -26,7 +26,7 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @param appKey 应用标识
* @param fieldCodes 列
* @param groupCode 分组code
* @param params 查询参数map
* @param params
查询参数map
* @return List<Map>
*/
List
<
Map
<
String
,
Object
>>
listAll
(
...
...
@@ -39,17 +39,35 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
/**
* 分页查询
*
* @param page 分页信息
* @param appKey 应用
* @param page
分页信息
* @param appKey
应用
* @param fieldCodes 字段
* @param groupCode 表单类型
* @return IPage<Map
<
String, Object>>
* @param groupCode
表单类型
* @return IPage<Map
<
String, Object>>
*/
IPage
<
Map
<
String
,
Object
>>
pageList
(
Page
page
,
@Param
(
"appKey"
)
String
appKey
,
@Param
(
"fieldCodes"
)
Map
<
String
,
Object
>
fieldCodes
,
@Param
(
"groupCode"
)
String
groupCode
,
@Param
(
"params"
)
Map
<
String
,
String
>
params
@Param
(
"params"
)
Map
<
String
,
String
>
params
);
/**
* 查询指定日期的值班信息
* @param dutyDay 值班日期
* @param shiftId 班次id
* @param fieldCodes 动态列
* @param appKey 应用标识
* @param groupCode 表单类型
* @param params 查询条件
* @return List<Map < String, Object>>
*/
List
<
Map
<
String
,
Object
>>
listOneDayDutyPerson
(
@Param
(
"dutyDate"
)
String
dutyDay
,
@Param
(
"shiftId"
)
Long
shiftId
,
@Param
(
"fieldCodes"
)
Map
<
String
,
Object
>
fieldCodes
,
@Param
(
"appKey"
)
String
appKey
,
@Param
(
"groupCode"
)
String
groupCode
,
@Param
(
"params"
)
Map
<
String
,
String
>
params
);
}
amos-boot-module/amos-boot-module-api/amos-boot-module-common-api/src/main/resources/mapper/DynamicFormInstanceMapper.xml
View file @
3e3a8108
...
...
@@ -91,4 +91,47 @@
</if>
order by instanceId desc
</select>
<select
id=
"listOneDayDutyPerson"
resultType=
"java.util.Map"
>
select
d.*,
ps.shift_id as shiftId,
ps.duty_date as dutyDate,
ds.name as shiftName
from
(
select
i.INSTANCE_ID instanceId,
i.GROUP_CODE groupCode,
<foreach
collection=
"fieldCodes"
item=
"value"
index=
"key"
separator=
","
>
MAX(CASE WHEN i.FIELD_CODE = #{key} THEN i.FIELD_VALUE END) as ${key}
</foreach>
from
cb_dynamic_form_instance i
where i.GROUP_CODE = #{groupCode}
and i.APP_KEY = #{appKey}
GROUP by
i.INSTANCE_ID ) d,
cb_duty_person_shift ps,
cb_duty_shift ds
where
d.instanceId = ps.instance_id
and ps.shift_id = ds.sequence_nbr
and ps.duty_date = #{dutyDate}
<if
test=
"shiftId != null and shiftId != ''"
>
and ps.shift_id = #{shiftId}
</if>
<if
test=
"params != null and params.size() > 0"
>
<foreach
collection=
"params"
index=
"key"
item=
"value"
separator=
""
>
<choose>
<when
test=
"fieldCodes[key] == 'like' and value !=null and value !=''"
>
and d.${key} like concat('%',#{value},'%')
</when>
<when
test=
"fieldCodes[key] == 'eq' and value !=null and value !=''"
>
and d.${key} = #{value}
</when>
</choose>
</foreach>
</if>
order by instanceId desc
</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/DutyCarController.java
View file @
3e3a8108
...
...
@@ -134,4 +134,13 @@ public class DutyCarController extends BaseController {
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
)
{
return
ResponseHelper
.
buildResponse
(
iDutyCarService
.
deleteDutyData
(
instanceId
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"查询指定日期值班人信息列表"
)
@GetMapping
(
"/person/{dutyDay}/list"
)
public
ResponseModel
listDutyPerson
(
@ApiParam
(
value
=
"值班日期"
,
required
=
true
)
@PathVariable
String
dutyDay
,
@ApiParam
(
value
=
"班次id"
)
@RequestParam
(
required
=
false
)
Long
shiftId
,
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
){
return
ResponseHelper
.
buildResponse
(
iDutyCarService
.
dayDutyPersonList
(
dutyDay
,
shiftId
,
postType
));
}
}
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 @
3e3a8108
...
...
@@ -33,7 +33,6 @@ public class DutyPersonController extends BaseController {
@Autowired
IDutyPersonService
iDutyPersonService
;
/**
* 值班列表视图--分页
*
...
...
@@ -120,4 +119,13 @@ public class DutyPersonController extends BaseController {
public
ResponseModel
deleteDutyData
(
@PathVariable
Long
instanceId
)
{
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
deleteDutyData
(
instanceId
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
"查询指定日期值班人信息列表"
)
@GetMapping
(
"/person/{dutyDay}/list"
)
public
ResponseModel
listDutyPerson
(
@ApiParam
(
value
=
"值班日期"
,
required
=
true
)
@PathVariable
String
dutyDay
,
@ApiParam
(
value
=
"班次id"
)
@RequestParam
(
required
=
false
)
Long
shiftId
,
@ApiParam
(
value
=
"岗位"
)
@RequestParam
(
required
=
false
)
String
postType
){
return
ResponseHelper
.
buildResponse
(
iDutyPersonService
.
dayDutyPersonList
(
dutyDay
,
shiftId
,
postType
));
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/service/IDutyCommonService.java
View file @
3e3a8108
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto
;
import
javax.servlet.http.HttpServletResponse
;
import
java.text.ParseException
;
...
...
@@ -62,4 +63,13 @@ public interface IDutyCommonService {
* @return Boolean
*/
Boolean
deleteDutyData
(
Long
instanceId
);
/**
* 查询指定条件的值班人信息
* @param dutyDay 查询条件
* @param shiftId 班次
* @param postType 岗位
* @return List<Map<String, Object>>
*/
List
<
Map
<
String
,
Object
>>
dayDutyPersonList
(
String
dutyDay
,
Long
shiftId
,
String
postType
);
}
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 @
3e3a8108
...
...
@@ -89,7 +89,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
.
le
(
endDate
!=
null
,
DutyPersonShift:
:
getDutyDate
,
endDate
)).
stream
().
map
(
e
->
{
DutyPersonShiftDto
dto
=
new
DutyPersonShiftDto
();
Bean
.
copyExistPropertis
(
e
,
dto
);
dto
.
setShiftName
(
keyNameMap
.
get
(
e
.
getShiftId
()));
//没值班信息,默认休
dto
.
setShiftName
(
e
.
getShiftId
()
!=
null
?
keyNameMap
.
get
(
e
.
getShiftId
())
:
"休"
);
return
dto
;
}).
collect
(
Collectors
.
toList
());
m
.
put
(
"dutyShift"
,
personShiftList
);
...
...
@@ -292,4 +293,16 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
dutyPersonShiftService
.
remove
(
new
LambdaQueryWrapper
<
DutyPersonShift
>().
eq
(
DutyPersonShift:
:
getInstanceId
,
instanceId
));
return
true
;
}
@Override
public
List
<
Map
<
String
,
Object
>>
dayDutyPersonList
(
String
dutyDay
,
Long
shiftId
,
String
postType
)
{
String
groupCode
=
this
.
getGroupCode
();
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
"postType"
,
postType
);
List
<
DynamicFormColumn
>
columns
=
dynamicFormColumnService
.
list
(
new
LambdaQueryWrapper
<
DynamicFormColumn
>().
eq
(
DynamicFormColumn:
:
getGroupCode
,
groupCode
));
Map
<
String
,
Object
>
fieldCodes
=
Bean
.
listToMap
(
columns
,
"fieldCode"
,
"queryStrategy"
,
DynamicFormColumn
.
class
);
return
dynamicFormInstanceService
.
getBaseMapper
().
listOneDayDutyPerson
(
dutyDay
,
shiftId
,
fieldCodes
,
RequestContext
.
getAppKey
(),
groupCode
,
params
);
}
}
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