Commit b7cdf1e6 authored by litengwei's avatar litengwei

巡检查询当日应巡查列表

parent 0ce25fd0
......@@ -148,6 +148,31 @@ public class CheckController extends AbstractBaseController {
return CommonResponseUtil.success(list);
}
/**
*
* 浙江省设备平台今日应巡查任务
* **/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "巡检记录查询", notes = "巡检记录查询")
@RequestMapping(value = "/listTaskNew", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse listTaskNew(
@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) CheckInfoPageParam param,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
ReginParams reginParams = getSelectedOrgInfo();
param.setOrderBy("checkDate desc");
param.setBizOrgCode(ObjectUtils.isEmpty(param.getBizOrgCode()) ?
"3".equals(param.getIsOK()) ? null : reginParams.getPersonIdentity().getCompanyBizOrgCode()
: param.getBizOrgCode());
if(commonPageable !=null){
param.setPageNumber(commonPageable.getPageNumber()-1);
param.setPageSize(commonPageable.getPageSize());
}
Page<CheckInfoVo> list = checkService.getPlanTaskCheckInfo(param);
return CommonResponseUtil.success(list);
}
......
......@@ -19,6 +19,10 @@ public interface CheckMapper extends BaseMapper {
List<CheckInfoVo> getCheckInfo(CheckInfoPageParam param);
long getPlanTaskCheckCount(CheckInfoPageParam param);
List<CheckInfoVo> getPlanTaskCheckInfo(CheckInfoPageParam param);
List<CheckInfoVo> getCheckInfoNew(CheckInfoPageParam param);
long getCheckInfoCount(CheckInfoPageParam param);
......
......@@ -168,6 +168,16 @@ public class CheckServiceImpl implements ICheckService {
return new PageImpl<>(content, param, total);
}
public Page<CheckInfoVo> getPlanTaskCheckInfo(CheckInfoPageParam param) {
long total = checkMapper.getPlanTaskCheckCount(param);
List<CheckInfoVo> content = Lists.newArrayList();
if (total == 0) {
return new PageImpl<>(content, param, total);
}
content = checkMapper.getPlanTaskCheckInfo(param);
return new PageImpl<>(content, param, total);
}
public Page<CheckInfoVo> getPeoplePatrolPage(CheckInfoPageParam param) {
long total = checkMapper.getPeoplePageCount(param);
List<CheckInfoVo> content = Lists.newArrayList();
......
......@@ -263,6 +263,8 @@ public interface ICheckService {
Page<CheckInfoVo> getCheckInfoNew(String toke,String product,String appKey,CheckInfoPageParam param);
Page<CheckInfoVo> getPlanTaskCheckInfo(CheckInfoPageParam param);
Page<CheckInfoVo> getPeoplePatrolPage(CheckInfoPageParam param);
Map<String, Object> getPeopleStatistic(String bizOrgCode, String userId);
......
......@@ -256,6 +256,56 @@
</choose>
</select>
<select id="getPlanTaskCheckCount" resultType="long">
SELECT
count(a.id)
FROM
p_plan_task_detail b
LEFT JOIN p_plan_task a ON a.id = b.task_no
LEFT JOIN p_plan c ON c.id = a.plan_id
LEFT JOIN p_point d ON d.id = b.point_id
LEFT JOIN p_route e ON e.id = a.route_id
LEFT JOIN wl_warehouse_structure wws ON wws.id = d.risk_source_id
LEFT JOIN p_check pc ON pc.plan_task_detail_id = b.id
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
and DATE_FORMAT( a.check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
</where>
</select>
<select id="getPlanTaskCheckInfo" resultMap="checkInfoMap">
SELECT
b.id,
e.NAME route_name,
d.NAME point_name,
a.user_name user_name,
wws.NAME address,
date_format( pc.check_time, '%Y-%m-%d %H:%i:%s' ) checkDate,
( CASE b.is_finish WHEN 0 THEN '未执行' WHEN 1 THEN '已执行' ELSE '未执行' END ) AS `Finish_Status`,
( CASE b.is_finish WHEN 0 THEN '尚未巡检' WHEN 1 THEN '按时完成' ELSE '超时漏检' END ) AS `is_ok`,
c.biz_org_name AS department_name
FROM
p_plan_task_detail b
LEFT JOIN p_plan_task a ON a.id = b.task_no
LEFT JOIN p_plan c ON c.id = a.plan_id
LEFT JOIN p_point d ON d.id = b.point_id
LEFT JOIN p_route e ON e.id = a.route_id
LEFT JOIN wl_warehouse_structure wws ON wws.id = d.risk_source_id
LEFT JOIN p_check pc ON pc.plan_task_detail_id = b.id
<where>
<if test="bizOrgCode != null and bizOrgCode != ''">
and a.org_code LIKE CONCAT(#{bizOrgCode},'%')
</if>
and DATE_FORMAT( a.check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
</where>
<choose>
<when test="pageSize==-1"></when>
<when test="pageSize!=-1">limit #{offset}, #{pageSize}</when>
</choose>
</select>
<select id="getCheckInfoNew" resultMap="checkInfoMap">
SELECT
a.id,
......
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