Commit 2979a0b3 authored by chenzhao's avatar chenzhao

规则配置 查询接口

parent f15e4593
package com.yeejoin.amos.boot.module.common.api.mapper; package com.yeejoin.amos.boot.module.common.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift; import com.yeejoin.amos.boot.module.common.api.entity.DutyPersonShift;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -132,4 +133,6 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> { ...@@ -132,4 +133,6 @@ public interface DutyPersonShiftMapper extends BaseMapper<DutyPersonShift> {
Map<String, Object> getFireTeamBySequenceNbr (long sequenceNbr); Map<String, Object> getFireTeamBySequenceNbr (long sequenceNbr);
List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company); List<Map<String, Object>> getFirstAidForTypeCodeAndCompanyId(long company);
List<Map<String, Object>> queryByCompanyId(Long companyId);
} }
...@@ -36,4 +36,6 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> { ...@@ -36,4 +36,6 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId, List<FirefightersExcelDto> exportToExcel(Boolean isDelete, String name, String postQualification, String fireTeamId,
String state, String areasExpertise, String jobTitle); String state, String areasExpertise, String jobTitle);
List<FirefightersDto> queryById(Long teamId,String[] gw);
} }
...@@ -91,4 +91,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> { ...@@ -91,4 +91,6 @@ public interface OrgUsrMapper extends BaseMapper<OrgUsr> {
List< Map<String,String>> getPersonSimpleDetail(); List< Map<String,String>> getPersonSimpleDetail();
List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList); List<Map<String, Long>> countDeptByCompanyId(@Param("companyIdList") List<String> companyIdList);
List<Map<String,Object>> queryCompanyId(Long id);
} }
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyPersonDto;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author DELL * @author DELL
...@@ -32,4 +33,6 @@ public interface IDutyPersonService extends IDutyCommonService { ...@@ -32,4 +33,6 @@ public interface IDutyPersonService extends IDutyCommonService {
* @return * @return
*/ */
List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId); List<DutyPersonDto> findByDutyAreaId(Long dutyAreaId);
List<Map<String, Object>> queryByCompanyId(Long companyId);
} }
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
and s.duty_date >= #{beginDate} and s.duty_date >= #{beginDate}
and s.duty_date <![CDATA[<=]]> and s.duty_date <![CDATA[<=]]>
#{endDate} #{endDate}
AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。 AND s.shift_id is not null <!--// BUG 2807 更新人员车辆排版值班的保存逻辑 如果没有填写数据则保存空数据 。
同步修改 查询 导出相关逻辑 by kongfm 2021-09-14 --> 同步修改 查询 导出相关逻辑 by kongfm 2021-09-14 -->
and s.app_Key = #{appKey} and s.app_Key = #{appKey}
GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 --> GROUP BY s.duty_date,s.shift_id <!--增添分组条件 根据班次分组技术 -->
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<if test="params != null and params!='' "> <if test="params != null and params!='' ">
and cd.field_value !='消防车驾驶员' and cd.field_value !='消防车驾驶员'
</if> </if>
AND cd.instance_id IN AND cd.instance_id IN
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=","> <foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId} #{instanceId}
</foreach> </foreach>
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS #{equipmentName}, ) AS #{equipmentName},
MAX( MAX(
CASE CASE
WHEN cd.FIELD_CODE = #{teamName} THEN WHEN cd.FIELD_CODE = #{teamName} THEN
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
cd.is_delete=0 cd.is_delete=0
group by cd.instance_id group by cd.instance_id
) result group by ${groupByName} ) result group by ${groupByName}
</select> </select>
<select id='getInstanceIdForSpecifyDateAndEquipment' <select id='getInstanceIdForSpecifyDateAndEquipment'
resultType='map'> resultType='map'>
...@@ -201,7 +201,7 @@ ...@@ -201,7 +201,7 @@
</select> </select>
<select id='getEquipmentOperator' resultType='map'> <select id='getEquipmentOperator' resultType='map'>
SELECT SELECT
result.userName result.userName
FROM FROM
( (
SELECT SELECT
...@@ -235,7 +235,7 @@ FROM ...@@ -235,7 +235,7 @@ FROM
cd.group_code = #{groupCode} cd.group_code = #{groupCode}
AND cds.instance_id IS NOT NULL AND cds.instance_id IS NOT NULL
AND cd.is_delete = 0 AND cd.is_delete = 0
AND cd.instance_id IN AND cd.instance_id IN
<foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=","> <foreach collection ='instanceIds' item='instanceId' index='index' open="(" close= ")" separator=",">
#{instanceId} #{instanceId}
</foreach> </foreach>
...@@ -243,8 +243,8 @@ FROM ...@@ -243,8 +243,8 @@ FROM
WHERE WHERE
result.postTypeName = #{operator} and result.name =#{duty} result.postTypeName = #{operator} and result.name =#{duty}
</select> </select>
<select id ='getPositionStaffDutyForSpecifyDate' resultType="map"> <select id ='getPositionStaffDutyForSpecifyDate' resultType="map">
SELECT SELECT
GROUP_CONCAT(ss.userName) AS userName, GROUP_CONCAT(ss.userName) AS userName,
...@@ -294,7 +294,7 @@ WHERE ...@@ -294,7 +294,7 @@ WHERE
GROUP BY GROUP BY
ss.postTypeName ss.postTypeName
</select> </select>
<select id='getDutyForSpecifyDate' resultType="map"> <select id='getDutyForSpecifyDate' resultType="map">
SELECT SELECT
ds.`name` ds.`name`
...@@ -307,7 +307,7 @@ AND dp.is_delete = 0 ...@@ -307,7 +307,7 @@ AND dp.is_delete = 0
AND NAME IS NOT NULL AND NAME IS NOT NULL
GROUP BY GROUP BY
NAME NAME
</select> </select>
<select id='getFireTeamBySequenceNbr' resultType="map"> <select id='getFireTeamBySequenceNbr' resultType="map">
...@@ -341,4 +341,26 @@ AND cft.type_code = ( ...@@ -341,4 +341,26 @@ AND cft.type_code = (
AND cft.company = #{company} AND cft.company = #{company}
</select> </select>
<select id='queryByCompanyId' resultType="map">
SELECT
e.field_code,
e.field_name,
e.field_value
FROM
cb_dynamic_form_instance e,
(SELECT
i.*
FROM
cb_dynamic_form_instance i
,
(SELECT * FROM `cb_duty_person_shift` where to_days(duty_date) = to_days(now())) b
WHERE
i.instance_id = b.instance_id
AND
i.field_code = 'deptId'
AND
i.field_value = #{companyId}) c
WHERE
e. instance_id = c.instance_id
</select>
</mapper> </mapper>
...@@ -685,4 +685,37 @@ LEFT JOIN ( ...@@ -685,4 +685,37 @@ LEFT JOIN (
#{companyId} #{companyId}
</foreach> </foreach>
</select> </select>
<select id="queryCompanyId" resultType="map">
SELECT
d.field_code ,
d.field_name ,
d.field_value ,
s.sequence_nbr,
s.biz_org_name,
s.parent_id
FROM
cb_dynamic_form_instance d ,
( SELECT
u.*
FROM
cb_org_usr u,
cb_dynamic_form_instance i
where
u.parent_id = #{id}
AND
u.is_delete = 0
AND
u.biz_org_type = 'PERSON'
AND
i.instance_id = u.sequence_nbr
AND
i.field_code = 'administrativePositionCode'
AND
i.field_value is not NULL ) s
WHERE
d.instance_id = s.sequence_nbr
AND
d.field_code = 'telephone'
</select>
</mapper> </mapper>
...@@ -191,4 +191,18 @@ public class DutyPersonController extends BaseController { ...@@ -191,4 +191,18 @@ public class DutyPersonController extends BaseController {
return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId)); return ResponseHelper.buildResponse(iDutyPersonService.findByDutyAreaId(dutyAreaId));
} }
/**
*
*
* @return ResponseModel
*/
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/companyId/{companyId}")
@ApiOperation(httpMethod = "GET", value = "查询当日值班人员", notes = "查询当日值班人员")
public ResponseModel<List<Map<String, Object>>> queryByCompanyId(
@PathVariable Long companyId) throws Exception {
return ResponseHelper.buildResponse(iDutyPersonService.queryByCompanyId(companyId));
}
} }
...@@ -267,4 +267,18 @@ public class OrgPersonController { ...@@ -267,4 +267,18 @@ public class OrgPersonController {
throw new RuntimeException("系统异常!"); throw new RuntimeException("系统异常!");
} }
} }
/**
* 机场单位下 各单位下人员岗位不为空的人员
*
* @param id
* @return
*/
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/companyId/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取人员岗位不为空的人员详情", notes = "获取人员岗位不为空的人员详情")
public ResponseModel<Object> queryCompanyId(HttpServletRequest request,
@PathVariable Long id) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.queryCompanyId(id));
}
} }
...@@ -10,6 +10,7 @@ import java.util.Map; ...@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.common.api.mapper.DutyPersonShiftMapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -37,6 +38,8 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut ...@@ -37,6 +38,8 @@ public class DutyPersonServiceImpl extends DutyCommonServiceImpl implements IDut
@Autowired @Autowired
EquipFeignClient equipFeign; EquipFeignClient equipFeign;
@Autowired
DutyPersonShiftMapper dutyPersonShiftMapper;
@Override @Override
...@@ -289,26 +292,29 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType ...@@ -289,26 +292,29 @@ public Object BuildScheduleDetails(String dutyDay, Long shiftId, String postType
System.out.println("ssssssssss"); System.out.println("ssssssssss");
}); });
} }
public List<Map<String, Object>> queryByCompanyId(Long companyId){
return dutyPersonShiftMapper.queryByCompanyId(companyId);
}
......
...@@ -129,7 +129,11 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi ...@@ -129,7 +129,11 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
public List<Map<String,String>> getFirefightersName() { public List<Map<String,String>> getFirefightersName() {
return firefightersMapper.getFirefightersName(); return firefightersMapper.getFirefightersName();
}
public List<FirefightersDto> queryById(Long teamId,String[] gw){
return firefightersMapper.queryById(teamId,gw);
} }
} }
...@@ -1859,4 +1859,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -1859,4 +1859,10 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return resultMap; return resultMap;
} }
public List<Map<String,Object>> queryCompanyId(Long id) {
return orgUsrMapper.queryCompanyId(id);
}
} }
...@@ -94,6 +94,7 @@ public class FirefightersController extends BaseController { ...@@ -94,6 +94,7 @@ public class FirefightersController extends BaseController {
@Value("${redis.cache.failure.time}") @Value("${redis.cache.failure.time}")
private long time; private long time;
/** /**
* 新增消防队员 * 新增消防队员
* *
...@@ -332,4 +333,22 @@ public class FirefightersController extends BaseController { ...@@ -332,4 +333,22 @@ public class FirefightersController extends BaseController {
return ResponseHelper.buildResponse(menus); return ResponseHelper.buildResponse(menus);
} }
/**
*查询
*
* @param
* @return
* @throws Exception
*/
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/gw/{id}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据id查询", notes = "根据id查询")
public ResponseModel<Object> queryById( @PathVariable Long teamId) throws Exception {
//规则提供岗位名称
String[] gw =new String[]{"1202","1203","1204","1205","1206","1207","1209","1208","1210","1211"};
return ResponseHelper.buildResponse(iFirefightersService.queryById(teamId,gw));
}
} }
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