Commit e36eb042 authored by jianqian's avatar jianqian

BASE

parent 7e36795d
......@@ -2,17 +2,9 @@ package com.zehong.web.controller.workOrder;
import com.github.pagehelper.PageInfo;
import java.util.List;
import java.util.Map;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.StringUtils;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo;
import org.apache.commons.math3.analysis.function.Add;
import org.aspectj.weaver.loadtime.Aj;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -21,15 +13,9 @@ import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.form.TWorkOrderForm;
import com.zehong.system.domain.vo.WorkOrderVo;
import com.zehong.system.service.ITWorkOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
......@@ -70,12 +56,12 @@ public class TWorkOrderController extends BaseController
* @throws Exception
*/
@GetMapping("/waitinglist")
public TableDataInfo waitinglist(String userId,@RequestParam(value = "type", defaultValue = "1")Integer type) throws Exception
public TableDataInfo waitinglist(String userId,@RequestParam(value = "type", defaultValue = "1")Integer type,String searchStr) throws Exception
{
startPage();
PageInfo<TWorkOrder> pageInfo;
try {
pageInfo = tWorkOrderService.selectWaitingWorkOrder(userId,type);
pageInfo = tWorkOrderService.selectWaitingWorkOrder(userId,type,searchStr);
} catch (Exception e) {
e.printStackTrace();
throw new Exception("查询待办工单失败");
......
......@@ -66,8 +66,13 @@ public class TWorkOrder extends BaseEntity
private String longitude;
private String latitude;
private String pictureUrl;
public void setOrderId(String orderId)
public String getPictureUrl() {
return pictureUrl;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
......
......@@ -42,7 +42,7 @@ public interface TWorkOrderMapper
* @param userId
* @return
*/
public List<TWorkOrder> selectWaitingWorkOrder(@Param("userId") String userId,@Param("type") Integer type);
public List<TWorkOrder> selectWaitingWorkOrder(@Param("userId") String userId,@Param("type") Integer type,@Param("searchStr") String searchStr);
/**
* 新增工单基础信息
......
......@@ -50,7 +50,7 @@ public interface ITWorkOrderService
* @return
* @throws Exception
*/
public PageInfo<TWorkOrder> selectWaitingWorkOrder(String userId,Integer type)throws Exception;
public PageInfo<TWorkOrder> selectWaitingWorkOrder(String userId,Integer type,String searchStr)throws Exception;
/**
* 新增工单基础信息
......
......@@ -2,9 +2,7 @@ package com.zehong.system.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.PageInfo;
import com.zehong.common.core.domain.entity.SysUser;
import com.zehong.common.utils.DateUtils;
......@@ -19,9 +17,6 @@ import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 工单基础信息Service业务层处理
*
......@@ -261,8 +256,8 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return
*/
@Override
public PageInfo<TWorkOrder> selectWaitingWorkOrder(String userId,Integer type){
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectWaitingWorkOrder(userId,type);
public PageInfo<TWorkOrder> selectWaitingWorkOrder(String userId,Integer type,String searchStr){
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectWaitingWorkOrder(userId,type,searchStr);
for(TWorkOrder t :workOrderList){
if(t.getOrderType().equals('3')){
String address = tDeviceAlarmMapper.selectAddressByOrderId(t.getOrderId());
......
......@@ -57,6 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
o.order_status > 0
</otherwise>
</choose>
<if test="searchStr!=null and searchStr!=''">
AND o.order_name LIKE concat('%',#{searchStr},'%')
</if>
and (o.appoint_inspector is null OR o.appoint_inspector = #{userId})
order by o.allot_time desc
</select>
......@@ -144,24 +147,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</choose>
<choose>
<when test='type=="1"'>
"" as latitude
"" as latitude,
</when>
<otherwise>
p.latitude as latitude
p.latitude as latitude,
</otherwise>
</choose>
<choose>
<when test='type!="2"'>
"" as pictureUrl
</when>
<otherwise>
p.picture_url as pictureUrl
</otherwise>
</choose>
FROM (SELECT order_id as orderId,order_name as orderName,order_type as orderType,
order_status as orderStatus,allot_time as allotTime,remarks,resource_id
order_status as orderStatus,allot_time as allotTime,remarks,resource_id as resourceId
FROM t_work_order WHERE order_id=#{orderId})t
<choose>
<when test='type=="1"'>
LEFT JOIN t_inspection_plan p ON p.plan_id = t.resource_id
LEFT JOIN t_inspection_plan p ON p.plan_id = t.resourceId
</when>
<when test='type=="2"'>
LEFT JOIN t_hidden_trouble p ON p.trouble_id = t.resource_id
LEFT JOIN t_hidden_trouble p ON p.trouble_id = t.resourceId
</when>
<otherwise>
LEFT JOIN t_device_alarm a ON a.alarm_id = t.resource_id
LEFT JOIN t_device_alarm a ON a.alarm_id = t.resourceId
LEFT JOIN t_device_info p ON p.device_id = a.`device_id`
</otherwise>
</choose>
......
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