Commit e36eb042 authored by jianqian's avatar jianqian

BASE

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