Commit f0fbd048 authored by 高建强's avatar 高建强

item:新增获取指定日期值班人员列表

parent b8cee47e
...@@ -152,4 +152,6 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -152,4 +152,6 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
String getFirstAidCompanyId (); String getFirstAidCompanyId ();
List<Map<String, Object>> dayDutyStatistics(String date, String groupCode, String fieldCode, String dictType); List<Map<String, Object>> dayDutyStatistics(String date, String groupCode, String fieldCode, String dictType);
List<Map<String, Object>> dayDutyList(String date, String dictCodes);
} }
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
i.field_value AS postTypeName, i.field_value AS postTypeName,
count( 1 ) AS total, count( 1 ) AS total,
d.`code`, d.`code`,
MAX( CASE d.`code` WHEN '1601' THEN 'firePerson' WHEN '1602' THEN 'opsPerson' WHEN '1601' THEN 'securityPerson' ELSE 'otherPerson' END ) AS postType MAX( CASE d.`code` WHEN '1601' THEN 'firePerson' WHEN '1602' THEN 'opsPerson' WHEN '1603' THEN 'securityPerson' WHEN '1604' THEN 'overhaulPerson' ELSE 'otherPerson' END ) AS postType
FROM FROM
cb_duty_person_shift s, cb_duty_person_shift s,
cb_dynamic_form_instance i cb_dynamic_form_instance i
...@@ -149,6 +149,52 @@ ...@@ -149,6 +149,52 @@
GROUP BY GROUP BY
i.field_value i.field_value
</select> </select>
<select id="dayDutyList" resultType="java.util.Map">
SELECT
id,
userName,
telephone,
peopleType
FROM
(
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 = 'positionType' 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>
<if test="date != null and date != ''">
ps.duty_date = #{date}
</if>
</where>
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
GROUP BY
a.id
) b
<where>
<if test="dictCodes != null and dictCodes.split(',').length >0">
b.peopleType IN
<foreach collection="dictCodes.split(',')" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
</where>
GROUP BY
b.id
</select>
<select id="genRangeDate" resultType="map"> <select id="genRangeDate" resultType="map">
SELECT SELECT
DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date, DATE_FORMAT(DATE( DATE_ADD( #{beginDate}, INTERVAL @s DAY )),'%Y-%m-%d') AS date,
......
...@@ -152,15 +152,25 @@ public class DutyPersonController extends BaseController { ...@@ -152,15 +152,25 @@ public class DutyPersonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/day-duty-statistics") @GetMapping("/day-duty-statistics")
@ApiOperation(httpMethod = "GET", value = "获取指定日期值班人员统计", notes = "获取指定日期值班人员统计") @ApiOperation(httpMethod = "GET", value = "获取指定日期值班人员统计", notes = "获取指定日期值班人员统计")
public ResponseModel<List<Map<String, Object>>> newDutyDetail( public ResponseModel<List<Map<String, Object>>> dayDutyStatistics(
@ApiParam(value = "值班日期", required = true) @RequestParam String date, @ApiParam(value = "值班日期") @RequestParam(required = false) String date,
@ApiParam(value = "分组编码", required = true) @RequestParam String groupCode, @ApiParam(value = "分组编码") @RequestParam(required = false) String groupCode,
@ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode, @ApiParam(value = "属性编码") @RequestParam(required = false) String fieldCode,
@ApiParam(value = "字典类型") @RequestParam(required = false) String dictType @ApiParam(value = "字典类型") @RequestParam(required = false) String dictType
) throws ParseException { ) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyStatistics(date, groupCode, fieldCode, dictType)); return ResponseHelper.buildResponse(iDutyPersonService.dayDutyStatistics(date, groupCode, fieldCode, dictType));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping("/day-duty-list")
@ApiOperation(httpMethod = "GET", value = "获取指定日期值班人员列表", notes = "获取指定日期值班人员列表")
public ResponseModel<List<Map<String, Object>>> dayDutyList(
@ApiParam(value = "值班日期") @RequestParam(required = false) String date,
@ApiParam(value = "字典编码") @RequestParam(required = false) String dictCodes
) throws ParseException {
return ResponseHelper.buildResponse(iDutyPersonService.dayDutyList(date, dictCodes));
}
/** /**
* 调班 * 调班
* *
......
...@@ -335,6 +335,11 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -335,6 +335,11 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
return dutyPersonShiftMapper.dayDutyStatistics(date, groupCode, fieldCode, dictType); return dutyPersonShiftMapper.dayDutyStatistics(date, groupCode, fieldCode, dictType);
} }
@Override
public List<Map<String, Object>> dayDutyList(String date, String dictCodes) {
return dutyPersonShiftMapper.dayDutyList(date, dictCodes);
}
public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) { public Object getSchedulingDutyForSpecifyDate(String dutyDay, Long shiftId, String postType, String fieldCode) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay, List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getNewEquipmentForSpecifyDate(dutyDay,
this.getGroupCode(), "deptId", "deptName", "result.deptId"); this.getGroupCode(), "deptId", "deptName", "result.deptId");
......
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