Commit db6ccbfa authored by 王晓倩's avatar 王晓倩

工单反馈更新设备最后巡检时间

parent 77b24007
package com.zehong.web.controller.workOrder; package com.zehong.web.controller.workOrder;
import java.util.List; import java.util.List;
import com.zehong.common.utils.StringUtils;
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.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -74,9 +76,16 @@ public class TOrderFeedbackController extends BaseController ...@@ -74,9 +76,16 @@ public class TOrderFeedbackController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:feedback:add')") @PreAuthorize("@ss.hasPermi('workOrder:feedback:add')")
@Log(title = "工单反馈信息", businessType = BusinessType.INSERT) @Log(title = "工单反馈信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TOrderFeedback tOrderFeedback) public AjaxResult add(@RequestBody TOrderFeedback tOrderFeedback) throws Exception
{ {
return toAjax(tOrderFeedbackService.insertTOrderFeedback(tOrderFeedback)); int result = 0;
try {
result = tOrderFeedbackService.insertTOrderFeedback(tOrderFeedback);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("工单反馈操作失败,数据有误"));
}
return toAjax(result);
} }
/** /**
......
...@@ -33,7 +33,7 @@ public interface ITOrderFeedbackService ...@@ -33,7 +33,7 @@ public interface ITOrderFeedbackService
* @param tOrderFeedback 工单反馈信息 * @param tOrderFeedback 工单反馈信息
* @return 结果 * @return 结果
*/ */
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback); public int insertTOrderFeedback(TOrderFeedback tOrderFeedback) throws Exception;
/** /**
* 修改工单反馈信息 * 修改工单反馈信息
......
...@@ -28,6 +28,10 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -28,6 +28,10 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
private THiddenTroubleMapper tHiddenTroubleMapper; private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired @Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper; private TDeviceAlarmMapper tDeviceAlarmMapper;
@Autowired
private TPipeMapper tPipeMapper;
@Autowired
private TDeviceInfoMapper tDeviceInfoMapper;
/** /**
* 查询工单反馈信息 * 查询工单反馈信息
...@@ -60,7 +64,7 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -60,7 +64,7 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback) public int insertTOrderFeedback(TOrderFeedback tOrderFeedback) throws Exception
{ {
if("2".equals(tOrderFeedback.getIsHiddenDanger())){ if("2".equals(tOrderFeedback.getIsHiddenDanger())){
tOrderFeedback.setDealStatus("1"); tOrderFeedback.setDealStatus("1");
...@@ -82,6 +86,15 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -82,6 +86,15 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
data.setUpdateTime(DateUtils.getNowDate()); data.setUpdateTime(DateUtils.getNowDate());
tInspectionDataMapper.updateTInspectionData(data); tInspectionDataMapper.updateTInspectionData(data);
if("0".equals(data.getDeviceType())){
TPipe pipe = tPipeMapper.selectTPipeByCode(deviceCode);
pipe.setInspectionTime(DateUtils.getNowDate());
tPipeMapper.updateTPipe(pipe);
} else {
TDeviceInfo device = tDeviceInfoMapper.selectTDeviceInfoByCode(deviceCode);
device.setInspectionTime(DateUtils.getNowDate());
tDeviceInfoMapper.updateTDeviceInfo(device);
}
} else if("2".equals(orderType)) { } else if("2".equals(orderType)) {
THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(order.getResourceId()); THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(order.getResourceId());
trouble.setDealStatus(dealStatus); trouble.setDealStatus(dealStatus);
......
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