Commit 9a173537 authored by 王晓倩's avatar 王晓倩

工单详细信息接口

parent 5bd418ce
...@@ -41,10 +41,16 @@ public class TWorkOrderController extends BaseController ...@@ -41,10 +41,16 @@ public class TWorkOrderController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TWorkOrder tWorkOrder) public TableDataInfo list(TWorkOrder tWorkOrder) throws Exception
{ {
startPage(); startPage();
List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("查询工单基础信息列表失败"));
}
return getDataTable(list); return getDataTable(list);
} }
...@@ -54,9 +60,15 @@ public class TWorkOrderController extends BaseController ...@@ -54,9 +60,15 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')")
@Log(title = "工单基础信息", businessType = BusinessType.EXPORT) @Log(title = "工单基础信息", businessType = BusinessType.EXPORT)
@GetMapping("/export") @GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder) public AjaxResult export(TWorkOrder tWorkOrder) throws Exception
{ {
List<WorkOrderVo> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder); List<WorkOrderVo> list = null;
try {
list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("导出工单基础信息列表失败"));
}
ExcelUtil<WorkOrderVo> util = new ExcelUtil<WorkOrderVo>(WorkOrderVo.class); ExcelUtil<WorkOrderVo> util = new ExcelUtil<WorkOrderVo>(WorkOrderVo.class);
return util.exportExcel(list, "工单基础信息数据"); return util.exportExcel(list, "工单基础信息数据");
} }
...@@ -66,9 +78,16 @@ public class TWorkOrderController extends BaseController ...@@ -66,9 +78,16 @@ public class TWorkOrderController extends BaseController
*/ */
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:query')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:query')")
@GetMapping(value = "/{orderId}") @GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") String orderId) public AjaxResult getInfo(@PathVariable("orderId") String orderId) throws Exception
{ {
return AjaxResult.success(tWorkOrderService.selectTWorkOrderById(orderId)); WorkOrderVo workOrderVo = new WorkOrderVo();
try {
workOrderVo = tWorkOrderService.selectTWorkOrderById(orderId);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("获取工单({})工详细信息失败", orderId));
}
return AjaxResult.success(workOrderVo);
} }
/** /**
...@@ -77,9 +96,15 @@ public class TWorkOrderController extends BaseController ...@@ -77,9 +96,15 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:add')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:add')")
@Log(title = "工单基础信息", businessType = BusinessType.INSERT) @Log(title = "工单基础信息", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder) public AjaxResult add(@RequestBody TWorkOrder tWorkOrder) throws Exception
{ {
return toAjax(tWorkOrderService.insertTWorkOrder(tWorkOrder)); try {
tWorkOrderService.insertTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("工单({})信息有误", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
} }
/** /**
...@@ -88,15 +113,21 @@ public class TWorkOrderController extends BaseController ...@@ -88,15 +113,21 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:edit')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:edit')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE) @Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception { public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus(); String orderStatus = tWorkOrder.getOrderStatus();
// 工单状态只有是0未下发或1已下发,才允许修改 // 工单状态只有是0未下发或1已下发,才允许修改
if(!"0".equals(orderStatus) && !"1".equals(orderStatus)){ if(!"0".equals(orderStatus) && !"1".equals(orderStatus)){
throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId())); throw new Exception(StringUtils.format("工单({})当前状态不允许修改", tWorkOrder.getOrderId()));
} }
return toAjax(tWorkOrderService.updateTWorkOrder(tWorkOrder)); try {
tWorkOrderService.updateTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("修改工单({})信息失败,", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
} }
/** /**
...@@ -105,11 +136,18 @@ public class TWorkOrderController extends BaseController ...@@ -105,11 +136,18 @@ public class TWorkOrderController extends BaseController
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:editStatus')") @PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:editStatus')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE) @Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping("/editStatus") @PutMapping("/editStatus")
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception { public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception
{
String orderStatus = tWorkOrder.getOrderStatus(); String orderStatus = tWorkOrder.getOrderStatus();
if("5".equals(orderStatus)) { if("5".equals(orderStatus)) {
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态。", tWorkOrder.getOrderId())); throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态", tWorkOrder.getOrderId()));
}
try {
tWorkOrderService.updateTWorkOrder(tWorkOrder);
} catch (Exception e) {
e.printStackTrace();
throw new Exception(StringUtils.format("修改工单({})状态失败", tWorkOrder.getOrderId()));
} }
return AjaxResult.success(); return AjaxResult.success();
} }
......
package com.zehong.system.domain.vo; package com.zehong.system.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity; import com.zehong.common.core.domain.BaseEntity;
import com.zehong.system.domain.TDeviceInfo;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 工单基础信息对象 t_work_order * 工单基础信息对象 t_work_order
...@@ -32,7 +33,10 @@ public class WorkOrderVo extends BaseEntity ...@@ -32,7 +33,10 @@ public class WorkOrderVo extends BaseEntity
private String orderName; private String orderName;
/** 设备编号 */ /** 设备编号 */
private String deviceIds; private String deviceCodes;
/** 设备列表 */
private List<TDeviceInfo> deviceInfoList;
/** 设备数量 */ /** 设备数量 */
private int deviceNum; private int deviceNum;
...@@ -78,7 +82,17 @@ public class WorkOrderVo extends BaseEntity ...@@ -78,7 +82,17 @@ public class WorkOrderVo extends BaseEntity
/** 备注 */ /** 备注 */
private String remarks; private String remarks;
public void setOrderId(String orderId) /** 反馈内容 */
private String contents;
/** 反馈时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date feedbackTime;
/** 处理状态 */
private String dealStatus;
public void setOrderId(String orderId)
{ {
this.orderId = orderId; this.orderId = orderId;
} }
...@@ -115,12 +129,20 @@ public class WorkOrderVo extends BaseEntity ...@@ -115,12 +129,20 @@ public class WorkOrderVo extends BaseEntity
return orderName; return orderName;
} }
public String getDeviceIds() { public String getDeviceCodes() {
return deviceIds; return deviceCodes;
} }
public void setDeviceIds(String deviceIds) { public void setDeviceCodes(String deviceCodes) {
this.deviceIds = deviceIds; this.deviceCodes = deviceCodes;
}
public List<TDeviceInfo> getDeviceInfoList() {
return deviceInfoList;
}
public void setDeviceInfoList(List<TDeviceInfo> deviceInfoList) {
this.deviceInfoList = deviceInfoList;
} }
public int getDeviceNum() { public int getDeviceNum() {
...@@ -242,6 +264,30 @@ public class WorkOrderVo extends BaseEntity ...@@ -242,6 +264,30 @@ public class WorkOrderVo extends BaseEntity
this.actualInspectorName = actualInspectorName; this.actualInspectorName = actualInspectorName;
} }
public String getContents() {
return contents;
}
public void setContents(String contents) {
this.contents = contents;
}
public Date getFeedbackTime() {
return feedbackTime;
}
public void setFeedbackTime(Date feedbackTime) {
this.feedbackTime = feedbackTime;
}
public String getDealStatus() {
return dealStatus;
}
public void setDealStatus(String dealStatus) {
this.dealStatus = dealStatus;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
...@@ -249,7 +295,7 @@ public class WorkOrderVo extends BaseEntity ...@@ -249,7 +295,7 @@ public class WorkOrderVo extends BaseEntity
.append("orderType", getOrderType()) .append("orderType", getOrderType())
.append("resourceId", getResourceId()) .append("resourceId", getResourceId())
.append("orderName", getOrderName()) .append("orderName", getOrderName())
.append("deviceIds", getDeviceIds()) .append("deviceCodes", getDeviceCodes())
.append("deviceNum", getDeviceNum()) .append("deviceNum", getDeviceNum())
.append("finishNum", getFinishNum()) .append("finishNum", getFinishNum())
.append("deviceType", getDeviceType()) .append("deviceType", getDeviceType())
......
...@@ -22,6 +22,14 @@ public interface TOrderFeedbackMapper ...@@ -22,6 +22,14 @@ public interface TOrderFeedbackMapper
/** /**
* 查询工单反馈信息列表 * 查询工单反馈信息列表
* *
* @param orderId 工单信息id
* @return 工单反馈信息集合
*/
public List<TOrderFeedback> selectTOrderFeedbackByOrderId(String orderId);
/**
* 查询工单反馈信息列表
*
* @param tOrderFeedback 工单反馈信息 * @param tOrderFeedback 工单反馈信息
* @return 工单反馈信息集合 * @return 工单反馈信息集合
*/ */
......
...@@ -19,7 +19,7 @@ public interface ITWorkOrderService ...@@ -19,7 +19,7 @@ public interface ITWorkOrderService
* @param orderId 工单基础信息ID * @param orderId 工单基础信息ID
* @return 工单基础信息 * @return 工单基础信息
*/ */
public WorkOrderVo selectTWorkOrderById(String orderId); public WorkOrderVo selectTWorkOrderById(String orderId) throws Exception;
/** /**
* 查询工单基础信息列表 * 查询工单基础信息列表
...@@ -27,7 +27,7 @@ public interface ITWorkOrderService ...@@ -27,7 +27,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息 * @param tWorkOrder 工单基础信息
* @return 工单基础信息集合 * @return 工单基础信息集合
*/ */
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder); public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception;
/** /**
* 新增工单基础信息 * 新增工单基础信息
...@@ -35,7 +35,7 @@ public interface ITWorkOrderService ...@@ -35,7 +35,7 @@ public interface ITWorkOrderService
* @param tWorkOrder 工单基础信息 * @param tWorkOrder 工单基础信息
* @return 结果 * @return 结果
*/ */
public int insertTWorkOrder(TWorkOrder tWorkOrder); public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception;
/** /**
* 修改工单基础信息 * 修改工单基础信息
......
package com.zehong.system.service.impl; package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import com.zehong.system.domain.*;
import com.zehong.system.mapper.*;
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 com.zehong.system.mapper.TOrderFeedbackMapper;
import com.zehong.system.domain.TOrderFeedback;
import com.zehong.system.service.ITOrderFeedbackService; import com.zehong.system.service.ITOrderFeedbackService;
/** /**
...@@ -18,6 +19,14 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -18,6 +19,14 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
{ {
@Autowired @Autowired
private TOrderFeedbackMapper tOrderFeedbackMapper; private TOrderFeedbackMapper tOrderFeedbackMapper;
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
@Autowired
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper;
/** /**
* 查询工单反馈信息 * 查询工单反馈信息
...@@ -53,10 +62,32 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService ...@@ -53,10 +62,32 @@ public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback) public int insertTOrderFeedback(TOrderFeedback tOrderFeedback)
{ {
String deviceCode = tOrderFeedback.getDeviceCode(); String deviceCode = tOrderFeedback.getDeviceCode();
// 更改巡检记录状态 String dealStatus = tOrderFeedback.getDealStatus();
if(deviceCode != null){
String dealStatus = tOrderFeedback.getDealStatus(); // 根据工单类型和源id修改源数据状态
TWorkOrder order = tWorkOrderMapper.selectTWorkOrderById(tOrderFeedback.getOrderId());
String orderType = order.getOrderType();
if("1".equals(orderType)){
TInspectionData data = tInspectionDataMapper.selectTInspectionDataByCode(deviceCode);
data.setDealStatus(dealStatus);
tInspectionDataMapper.updateTInspectionData(data);
} else if("2".equals(orderType)) {
THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(order.getResourceId());
trouble.setDealStatus(dealStatus);
tHiddenTroubleMapper.updateTHiddenTrouble(trouble);
} else {
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(order.getResourceId());
alarm.setDealStatus(dealStatus);
tDeviceAlarmMapper.updateTDeviceAlarm(alarm);
}
// 如果工单状态是进行中,修改状态为已反馈
if("2".equals(order.getOrderStatus())){
order.setOrderStatus("3");
tWorkOrderMapper.updateTWorkOrder(order);
} }
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback); return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
......
...@@ -26,12 +26,14 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -26,12 +26,14 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
@Autowired @Autowired
private TWorkOrderMapper tWorkOrderMapper; private TWorkOrderMapper tWorkOrderMapper;
@Autowired @Autowired
private SysUserMapper sysUserMapper; private TOrderFeedbackMapper tOrderFeedbackMapper;
@Autowired @Autowired
private TInspectionDataMapper tInspectionDataMapper; private SysUserMapper sysUserMapper;
@Autowired @Autowired
private TInspectionPlanMapper tInspectionPlanMapper; private TInspectionPlanMapper tInspectionPlanMapper;
@Autowired @Autowired
private TInspectionDataMapper tInspectionDataMapper;
@Autowired
private THiddenTroubleMapper tHiddenTroubleMapper; private THiddenTroubleMapper tHiddenTroubleMapper;
@Autowired @Autowired
private TDeviceAlarmMapper tDeviceAlarmMapper; private TDeviceAlarmMapper tDeviceAlarmMapper;
...@@ -50,7 +52,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -50,7 +52,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息 * @return 工单基础信息
*/ */
@Override @Override
public WorkOrderVo selectTWorkOrderById(String orderId) public WorkOrderVo selectTWorkOrderById(String orderId) throws Exception
{ {
WorkOrderVo workOrderVo = new WorkOrderVo(); WorkOrderVo workOrderVo = new WorkOrderVo();
TWorkOrder tWorkOrder = tWorkOrderMapper.selectTWorkOrderById(orderId); TWorkOrder tWorkOrder = tWorkOrderMapper.selectTWorkOrderById(orderId);
...@@ -74,20 +76,31 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -74,20 +76,31 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
if("1".equals(orderType)){ if("1".equals(orderType)){
TInspectionPlan plan = tInspectionPlanMapper.selectTInspectionPlanById(resourceId); TInspectionPlan plan = tInspectionPlanMapper.selectTInspectionPlanById(resourceId);
workOrderVo.setDeviceIds(plan.getDeviceCodes()); workOrderVo.setDeviceCodes(plan.getDeviceCodes());
TInspectionData data = new TInspectionData(); TInspectionData data = new TInspectionData();
data.setPlanId(resourceId); data.setPlanId(resourceId);
List<TInspectionData> totalList = tInspectionDataMapper.selectTInspectionDataList(data); List<TInspectionData> totalList = tInspectionDataMapper.selectTInspectionDataList(data);
workOrderVo.setDeviceNum(totalList.size()); workOrderVo.setDeviceNum(totalList.size());
List<TDeviceInfo> deviceInfoList = new ArrayList<>();
TDeviceInfo deviceInfo = null;
for(TInspectionData temp : totalList){
deviceInfo = tDeviceInfoMapper.selectTDeviceInfoByCode(temp.getDeviceCode());
if(deviceInfo != null){
deviceInfoList.add(deviceInfo);
}
}
int finish = tInspectionDataMapper.selectFinishTInspectionData(resourceId); int finish = tInspectionDataMapper.selectFinishTInspectionData(resourceId);
workOrderVo.setFinishNum(finish); workOrderVo.setFinishNum(finish);
} else if("2".equals(orderType)){ } else if("2".equals(orderType)){
THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(resourceId); THiddenTrouble trouble = tHiddenTroubleMapper.selectTHiddenTroubleById(resourceId);
workOrderVo.setDeviceIds((trouble.getDeviceCode() != null ? trouble.getDeviceCode() : null).toString()); workOrderVo.setDeviceCodes((trouble.getDeviceCode() != null ? trouble.getDeviceCode() : null).toString());
workOrderVo.setLongitude(trouble.getLongitude() != null ? trouble.getLongitude() : null); workOrderVo.setLongitude(trouble.getLongitude() != null ? trouble.getLongitude() : null);
workOrderVo.setLatitude(trouble.getLatitude() != null ? trouble.getLatitude() : null); workOrderVo.setLatitude(trouble.getLatitude() != null ? trouble.getLatitude() : null);
workOrderVo.setCoordinates(trouble.getCoordinates() != null ? trouble.getCoordinates() : null); workOrderVo.setCoordinates(trouble.getCoordinates() != null ? trouble.getCoordinates() : null);
...@@ -97,7 +110,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -97,7 +110,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(resourceId); TDeviceAlarm alarm = tDeviceAlarmMapper.selectTDeviceAlarmById(resourceId);
String deviceCode = alarm.getDeviceCode(); String deviceCode = alarm.getDeviceCode();
workOrderVo.setDeviceIds(String.valueOf(deviceCode)); workOrderVo.setDeviceCodes(String.valueOf(deviceCode));
String isPipe = alarm.getIsPipe(); String isPipe = alarm.getIsPipe();
if("0".equals(isPipe)){ if("0".equals(isPipe)){
...@@ -110,8 +123,16 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -110,8 +123,16 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
workOrderVo.setLatitude(device.getLatitude()); workOrderVo.setLatitude(device.getLatitude());
workOrderVo.setDeviceType(device.getDeviceType()); workOrderVo.setDeviceType(device.getDeviceType());
} }
}
List<TOrderFeedback> feedbackList = tOrderFeedbackMapper.selectTOrderFeedbackByOrderId(tWorkOrder.getOrderId());
if(feedbackList.size() != 0){
TOrderFeedback feedback = feedbackList.get(0);
workOrderVo.setContents(feedback.getContents());
workOrderVo.setFeedbackTime(feedback.getFeedbackTime());
workOrderVo.setDealStatus(feedback.getDealStatus());
} }
return workOrderVo; return workOrderVo;
} }
...@@ -122,7 +143,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -122,7 +143,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 工单基础信息 * @return 工单基础信息
*/ */
@Override @Override
public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) public List<WorkOrderVo> selectTWorkOrderList(TWorkOrder tWorkOrder) throws Exception
{ {
List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>(); List<WorkOrderVo> workOrderVoList = new ArrayList<WorkOrderVo>();
List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrder); List<TWorkOrder> workOrderList = tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
...@@ -157,12 +178,12 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -157,12 +178,12 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertTWorkOrder(TWorkOrder tWorkOrder) public int insertTWorkOrder(TWorkOrder tWorkOrder) throws Exception
{ {
String orderId = tWorkOrderMapper.getWorkOrderId(); String orderId = tWorkOrderMapper.getWorkOrderId();
tWorkOrder.setOrderId(orderId); tWorkOrder.setOrderId(orderId);
tWorkOrder.setOrderStatus("0"); tWorkOrder.setOrderStatus("0");
tWorkOrder.setCreateTime(DateUtils.getNowDate()); tWorkOrder.setAllotTime(DateUtils.getNowDate());
int planId = tWorkOrder.getResourceId(); int planId = tWorkOrder.getResourceId();
// 修改巡检计划状态为已下发 // 修改巡检计划状态为已下发
...@@ -181,7 +202,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -181,7 +202,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateTWorkOrder(TWorkOrder tWorkOrder) public int updateTWorkOrder(TWorkOrder tWorkOrder) throws Exception
{ {
if("1".equals(tWorkOrder.getOrderStatus())){ if("1".equals(tWorkOrder.getOrderStatus())){
...@@ -204,6 +225,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -204,6 +225,7 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
tInspectionPlanService.updateTInspectionPlan(plan); tInspectionPlanService.updateTInspectionPlan(plan);
} }
tWorkOrder.setUpdateTime(DateUtils.getNowDate());
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder); return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
} }
......
...@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectTDeviceAlarmById" parameterType="Long" resultMap="TDeviceAlarmResult"> <select id="selectTDeviceAlarmById" parameterType="int" resultMap="TDeviceAlarmResult">
<include refid="selectTDeviceAlarmVo"/> <include refid="selectTDeviceAlarmVo"/>
where alarm_id = #{alarmId} where alarm_id = #{alarmId}
</select> </select>
......
...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectTDeviceInfoById" parameterType="Long" resultMap="TDeviceInfoResult"> <select id="selectTDeviceInfoById" parameterType="int" resultMap="TDeviceInfoResult">
<include refid="selectTDeviceInfoVo"/> <include refid="selectTDeviceInfoVo"/>
where device_id = #{deviceId} where device_id = #{deviceId}
</select> </select>
......
...@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -48,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectTEnterpriseInfoById" parameterType="Long" resultMap="TEnterpriseInfoResult"> <select id="selectTEnterpriseInfoById" parameterType="int" resultMap="TEnterpriseInfoResult">
<include refid="selectTEnterpriseInfoVo"/> <include refid="selectTEnterpriseInfoVo"/>
where info_id = #{infoId} where info_id = #{infoId}
</select> </select>
......
...@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -36,7 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectTHiddenTroubleById" parameterType="Long" resultMap="THiddenTroubleResult"> <select id="selectTHiddenTroubleById" parameterType="int" resultMap="THiddenTroubleResult">
<include refid="selectTHiddenTroubleVo"/> <include refid="selectTHiddenTroubleVo"/>
where trouble_id = #{troubleId} where trouble_id = #{troubleId}
</select> </select>
......
...@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectFinishTInspectionData" parameterType="int"> <select id="selectFinishTInspectionData" parameterType="int" resultType="int">
select count(*) from t_inspection_data select count(*) from t_inspection_data
where plan_id = #{planId} where plan_id = #{planId}
and deal_status != null and deal_status != null
......
...@@ -38,11 +38,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -38,11 +38,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectTOrderFeedbackById" parameterType="Long" resultMap="TOrderFeedbackResult"> <select id="selectTOrderFeedbackById" parameterType="int" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/> <include refid="selectTOrderFeedbackVo"/>
where feedback_id = #{feedbackId} where feedback_id = #{feedbackId}
</select> </select>
<select id="selectTOrderFeedbackByOrderId" parameterType="String" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/>
where order_id = #{orderId}
order by feedback_time desc
</select>
<insert id="insertTOrderFeedback" parameterType="TOrderFeedback"> <insert id="insertTOrderFeedback" parameterType="TOrderFeedback">
insert into t_order_feedback insert into t_order_feedback
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
...@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selectTPipeById" parameterType="Long" resultMap="TPipeResult"> <select id="selectTPipeById" parameterType="int" resultMap="TPipeResult">
<include refid="selectTPipeVo"/> <include refid="selectTPipeVo"/>
where pipe_id = #{pipeId} where pipe_id = #{pipeId}
</select> </select>
......
...@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="resourceId" column="resource_id" /> <result property="resourceId" column="resource_id" />
<result property="orderName" column="order_name" /> <result property="orderName" column="order_name" />
<result property="orderStatus" column="order_status" /> <result property="orderStatus" column="order_status" />
<result property="createTime" column="create_time" /> <result property="updateTime" column="update_time" />
<result property="appointInspector" column="appoint_inspector" /> <result property="appointInspector" column="appoint_inspector" />
<result property="allotTime" column="allot_time" /> <result property="allotTime" column="allot_time" />
<result property="actualInspector" column="actual_inspector" /> <result property="actualInspector" column="actual_inspector" />
...@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<sql id="selectTWorkOrderVo"> <sql id="selectTWorkOrderVo">
select order_id, order_type, resource_id, order_name, order_status, create_time, appoint_inspector, allot_time, actual_inspector, actual_time, remarks from t_work_order select order_id, order_type, resource_id, order_name, order_status, update_time, appoint_inspector, allot_time, actual_inspector, actual_time, remarks from t_work_order
</sql> </sql>
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult"> <select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult">
...@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">resource_id,</if> <if test="resourceId != null">resource_id,</if>
<if test="orderName != null">order_name,</if> <if test="orderName != null">order_name,</if>
<if test="orderStatus != null">order_status,</if> <if test="orderStatus != null">order_status,</if>
<if test="createTime != null">create_time,</if> <if test="updateTime != null">update_time,</if>
<if test="appointInspector != null">appoint_inspector,</if> <if test="appointInspector != null">appoint_inspector,</if>
<if test="allotTime != null">allot_time,</if> <if test="allotTime != null">allot_time,</if>
<if test="actualInspector != null">actual_inspector,</if> <if test="actualInspector != null">actual_inspector,</if>
...@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -66,7 +66,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="resourceId != null">#{resourceId},</if> <if test="resourceId != null">#{resourceId},</if>
<if test="orderName != null">#{orderName},</if> <if test="orderName != null">#{orderName},</if>
<if test="orderStatus != null">#{orderStatus},</if> <if test="orderStatus != null">#{orderStatus},</if>
<if test="createTime != null">#{createTime},</if> <if test="updateTime != null">#{updateTime},</if>
<if test="appointInspector != null">#{appointInspector},</if> <if test="appointInspector != null">#{appointInspector},</if>
<if test="allotTime != null">#{allotTime},</if> <if test="allotTime != null">#{allotTime},</if>
<if test="actualInspector != null">#{actualInspector},</if> <if test="actualInspector != null">#{actualInspector},</if>
...@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="orderType != null">order_type = #{orderType},</if> <if test="orderType != null">order_type = #{orderType},</if>
<if test="orderName != null">order_name = #{orderName},</if> <if test="orderName != null">order_name = #{orderName},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if> <if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="appointInspector != null">appoint_inspector = #{appointInspector},</if> <if test="appointInspector != null">appoint_inspector = #{appointInspector},</if>
<if test="allotTime != null">allot_time = #{allotTime},</if> <if test="allotTime != null">allot_time = #{allotTime},</if>
<if test="actualInspector != null">actual_inspector = #{actualInspector},</if> <if test="actualInspector != null">actual_inspector = #{actualInspector},</if>
......
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