手持接口-巡检工单
parent
b865658cb2
commit
fab6f3aa28
@ -0,0 +1,61 @@
|
||||
package com.op.device.controller;
|
||||
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.device.domain.EquOrder;
|
||||
import com.op.device.service.IDevicePDAService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* PDAController
|
||||
*
|
||||
* @author wws
|
||||
* @date 2023-10-23
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/devicePDA")
|
||||
public class DevicePDAController {
|
||||
|
||||
@Autowired
|
||||
private IDevicePDAService devicePDAService;
|
||||
|
||||
/**
|
||||
* 获取今日巡检任务工单list
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getTodayTask")
|
||||
public AjaxResult getTodayTask(int userId) {
|
||||
return devicePDAService.getTodayTask(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取巡检记录
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getTaskRecord")
|
||||
public AjaxResult getTaskRecord(int userId) {
|
||||
return devicePDAService.getTaskRecord(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务详情
|
||||
* @param equOrder
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getInspectionOrderInfo")
|
||||
public AjaxResult getInspectionOrderInfo(@RequestBody EquOrder equOrder) {
|
||||
return devicePDAService.getInspectionOrderInfo(equOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 填写巡检记录工单
|
||||
* @param equOrder
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/updateInspectionRecord")
|
||||
public AjaxResult updateInspectionRecord(@RequestBody EquOrder equOrder) {
|
||||
return devicePDAService.updateInspectionRecord(equOrder);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.op.device.service;
|
||||
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.device.domain.EquOrder;
|
||||
|
||||
/**
|
||||
* PDAService
|
||||
*
|
||||
* @author wws
|
||||
* @date 2023-10-23
|
||||
*/
|
||||
public interface IDevicePDAService {
|
||||
|
||||
/**
|
||||
* 获取今日巡检任务工单list
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getTodayTask(int userId);
|
||||
|
||||
/**
|
||||
* 获取巡检记录
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getTaskRecord(int userId);
|
||||
|
||||
/**
|
||||
* 获取任务详情
|
||||
* @param equOrder
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getInspectionOrderInfo(EquOrder equOrder);
|
||||
|
||||
/**
|
||||
* 填写巡检记录工单
|
||||
* @param equOrder
|
||||
* @return
|
||||
*/
|
||||
AjaxResult updateInspectionRecord(EquOrder equOrder);
|
||||
}
|
@ -0,0 +1,132 @@
|
||||
package com.op.device.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.device.domain.EquOrder;
|
||||
import com.op.device.domain.EquOrderDetail;
|
||||
import com.op.device.domain.EquOrderEqu;
|
||||
import com.op.device.domain.EquOrderStandard;
|
||||
import com.op.device.mapper.*;
|
||||
import com.op.device.service.IDevicePDAService;
|
||||
import com.op.system.api.domain.SysUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.op.common.core.web.domain.AjaxResult.error;
|
||||
import static com.op.common.core.web.domain.AjaxResult.success;
|
||||
|
||||
/**
|
||||
* PDAService实现类
|
||||
*
|
||||
* @author wws
|
||||
* @date 2023-10-23
|
||||
*/
|
||||
@Service
|
||||
public class DevicePDAServiceImpl implements IDevicePDAService {
|
||||
|
||||
@Autowired
|
||||
private EquOrderMapper equOrderMapper;
|
||||
@Autowired
|
||||
private EquOrderEquMapper equOrderEquMapper;
|
||||
@Autowired
|
||||
private EquOrderDetailMapper equOrderDetailMapper;
|
||||
@Autowired
|
||||
private EquOrderStandardMapper equOrderStandardMapper;
|
||||
@Autowired
|
||||
private EquOrderPersonMapper equOrderPersonMapper;
|
||||
@Autowired
|
||||
private PersonMapper personMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 获取今日巡检任务工单list
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public AjaxResult getTodayTask(int userId) {
|
||||
List<EquOrder> orderList = equOrderMapper.selectTodayTask(userId);
|
||||
return success(orderList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取巡检记录
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public AjaxResult getTaskRecord(int userId) {
|
||||
List<EquOrder> orderList = equOrderMapper.selectTaskRecord(userId);
|
||||
return success(orderList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务详情
|
||||
*
|
||||
* @param equOrder
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public AjaxResult getInspectionOrderInfo(EquOrder equOrder) {
|
||||
List<EquOrder> orderList = equOrderMapper.selectEquOrderList(equOrder);
|
||||
if (orderList.size() > 1) {
|
||||
return error(500, "查询到多个任务详情!");
|
||||
}
|
||||
if (orderList.size() == 0) {
|
||||
return error(500, "未查询到任务信息!");
|
||||
}
|
||||
EquOrder order = orderList.get(0);
|
||||
|
||||
List<Date> timeArray = new ArrayList<>();
|
||||
timeArray.add(order.getOrderStart());
|
||||
timeArray.add(order.getOrderEnd());
|
||||
order.setTimeArray(timeArray);
|
||||
|
||||
order.setPlanName(equOrderMapper.selectPlanNameByPlanCode(order.getOrderCode()));
|
||||
|
||||
order.setWorkCenterName(equOrderMapper.selectCenterNameByCenterCode(order.getPlanWorkshop()));
|
||||
|
||||
EquOrderEqu equ = equOrderEquMapper.selectEquOrderEquListByParentCode(order.getOrderCode());
|
||||
|
||||
List<EquOrderDetail> detailList = equOrderDetailMapper.selectEquOrderDetailByParentCode(equ.getCode());
|
||||
for (EquOrderDetail detail : detailList) {
|
||||
List<EquOrderStandard> standardList = equOrderStandardMapper.selectEquOrderStandardByParentCode(detail.getCode());
|
||||
detail.setStandardList(standardList);
|
||||
}
|
||||
equ.setDetailList(detailList);
|
||||
|
||||
// 人员信息
|
||||
List<String> users = equOrderPersonMapper.selectEquOrderPersonByOrderCode(order.getOrderCode());
|
||||
|
||||
List<SysUser> personList = new ArrayList<>();
|
||||
|
||||
for (String id : users) {
|
||||
personList.add(personMapper.selectSysUserByUserId(Long.valueOf(id)));
|
||||
}
|
||||
|
||||
order.setPersonList(personList);
|
||||
|
||||
order.setEqu(equ);
|
||||
|
||||
return success(order);
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 填写巡检记录工单
|
||||
* @param equOrder
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public AjaxResult updateInspectionRecord(EquOrder equOrder) {
|
||||
return success(equOrder);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue