Commit 5d52e8dc authored by 付培阳's avatar 付培阳

今日值班列表查询接口

parent 1f1b440f
spring.application.name=JCS
spring.application.name=JCS_FPY
server.servlet.context-path=/jcs
server.port=11100
spring.profiles.active=dev
......
......@@ -70,4 +70,20 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
@Param("appKey") String appKey,
@Param("groupCode") String groupCode,
@Param("params") Map<String, String> params);
/**
* 查询当前值班信息
* @param dutyDay 值班日期
* @param shiftIds 班次id
* @param fieldCodes 动态列
* @param appKey 应用标识
* @param groupCode 表单类型
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> listOnDutyPerson(
@Param("dutyDate") String dutyDay,
@Param("shiftId") String shiftIds,
@Param("fieldCodes") Map<String, Object> fieldCodes,
@Param("appKey") String appKey,
@Param("groupCode") String groupCode);
}
......@@ -2,8 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.common.api.mapper.DynamicFormInstanceMapper">
<select id="selectListByCalledId" resultType="com.yeejoin.amos.boot.module.common.api.dto.DynamicFormInstanceDto">
SELECT
v.sequence_nbr sequenceNbr,
SELECT v.sequence_nbr sequenceNbr,
v.form_column_id formColumnId,
v.instance_id instanceId,
v.group_code groupCode,
......@@ -17,10 +16,9 @@
v.is_delete isDelete,
v.block block,
f.field_type fieldType
FROM
cb_dynamic_form_instance v
FROM cb_dynamic_form_instance v
LEFT JOIN cb_dynamic_form_column f ON f.sequence_nbr = v.form_column_id
WHERE v.instance_id=#{id}
WHERE v.instance_id = #{id}
</select>
<select id="listAll" resultType="java.util.Map">
select
......@@ -134,4 +132,35 @@
</if>
order by instanceId desc
</select>
<select id="listOnDutyPerson" 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 in (#{shiftId})
</if>
order by instanceId desc
</select>
</mapper>
......@@ -14,6 +14,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.ParseException;
import java.util.List;
......@@ -111,6 +112,7 @@ public class DutyPersonController extends BaseController {
/**
* 值班数据删除
*
* @param instanceId 实例id
* @return ResponseModel
*/
......@@ -129,7 +131,8 @@ public class DutyPersonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/exportExcel")
@ApiOperation(httpMethod = "GET", value = "人员执勤导出", notes = "人员执勤导出")
public ResponseModel exportExcel(HttpServletResponse response, @ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
public ResponseModel exportExcel(HttpServletResponse response,
@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.downloadList(beginDate, endDate));
}
......@@ -137,9 +140,19 @@ public class DutyPersonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询指定日期值班人信息列表")
@GetMapping("/person/{dutyDay}/list")
public ResponseModel listDutyPerson(@ApiParam(value = "值班日期",required = true) @PathVariable String dutyDay,
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));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询当前值班人信息列表")
@GetMapping("/person/on_duty/list")
public ResponseModel listOnDutyPerson(HttpServletRequest request) {
String appKey = request.getHeader("appKey");
return ResponseHelper.buildResponse(iDutyPersonService.listOnDutyPerson(appKey));
}
}
......@@ -57,6 +57,7 @@ public interface IDutyCommonService {
/**
* 删除值班数据
*
* @param instanceId 实例id
* @return Boolean
*/
......@@ -64,10 +65,18 @@ public interface IDutyCommonService {
/**
* 查询指定条件的值班人信息
*
* @param dutyDay 查询条件
* @param shiftId 班次
* @param postType 岗位
* @return List<Map<String, Object>>
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> dayDutyPersonList(String dutyDay, Long shiftId, String postType);
/**
* 查询当前值班人信息
*
* @return List<Map < String, Object>>
*/
List<Map<String, Object>> dayDutyPersonList(String dutyDay,Long shiftId,String postType);
List<Map<String, Object>> listOnDutyPerson(String appKey);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment