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

工单基础信息、工单反馈信息

parent d39acaf5
package com.zehong.web.controller.workOrder;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TOrderFeedback;
import com.zehong.system.service.ITOrderFeedbackService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 工单反馈信息Controller
*
* @author zehong
* @date 2021-07-19
*/
@RestController
@RequestMapping("/workOrder/feedback")
public class TOrderFeedbackController extends BaseController
{
@Autowired
private ITOrderFeedbackService tOrderFeedbackService;
/**
* 查询工单反馈信息列表
*/
@PreAuthorize("@ss.hasPermi('workOrder:feedback:list')")
@GetMapping("/list")
public TableDataInfo list(TOrderFeedback tOrderFeedback)
{
startPage();
List<TOrderFeedback> list = tOrderFeedbackService.selectTOrderFeedbackList(tOrderFeedback);
return getDataTable(list);
}
/**
* 导出工单反馈信息列表
*/
@PreAuthorize("@ss.hasPermi('workOrder:feedback:export')")
@Log(title = "工单反馈信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TOrderFeedback tOrderFeedback)
{
List<TOrderFeedback> list = tOrderFeedbackService.selectTOrderFeedbackList(tOrderFeedback);
ExcelUtil<TOrderFeedback> util = new ExcelUtil<TOrderFeedback>(TOrderFeedback.class);
return util.exportExcel(list, "工单反馈信息数据");
}
/**
* 获取工单反馈信息详细信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:feedback:query')")
@GetMapping(value = "/{feedbackId}")
public AjaxResult getInfo(@PathVariable("feedbackId") Long feedbackId)
{
return AjaxResult.success(tOrderFeedbackService.selectTOrderFeedbackById(feedbackId));
}
/**
* 新增工单反馈信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:feedback:add')")
@Log(title = "工单反馈信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TOrderFeedback tOrderFeedback)
{
return toAjax(tOrderFeedbackService.insertTOrderFeedback(tOrderFeedback));
}
/**
* 修改工单反馈信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:feedback:edit')")
@Log(title = "工单反馈信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TOrderFeedback tOrderFeedback)
{
return toAjax(tOrderFeedbackService.updateTOrderFeedback(tOrderFeedback));
}
/**
* 删除工单反馈信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:feedback:remove')")
@Log(title = "工单反馈信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{feedbackIds}")
public AjaxResult remove(@PathVariable Long[] feedbackIds)
{
return toAjax(tOrderFeedbackService.deleteTOrderFeedbackByIds(feedbackIds));
}
}
package com.zehong.web.controller.workOrder;
import java.util.List;
import com.zehong.common.utils.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.service.ITWorkOrderService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 工单基础信息Controller
*
* @author zehong
* @date 2021-07-19
*/
@RestController
@RequestMapping("/workOrder/basicsInfo")
public class TWorkOrderController extends BaseController
{
@Autowired
private ITWorkOrderService tWorkOrderService;
/**
* 查询工单基础信息列表
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:list')")
@GetMapping("/list")
public TableDataInfo list(TWorkOrder tWorkOrder)
{
startPage();
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
return getDataTable(list);
}
/**
* 导出工单基础信息列表
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:export')")
@Log(title = "工单基础信息", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TWorkOrder tWorkOrder)
{
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
ExcelUtil<TWorkOrder> util = new ExcelUtil<TWorkOrder>(TWorkOrder.class);
return util.exportExcel(list, "工单基础信息数据");
}
/**
* 获取工单基础信息详细信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:query')")
@GetMapping(value = "/{orderId}")
public AjaxResult getInfo(@PathVariable("orderId") String orderId)
{
return AjaxResult.success(tWorkOrderService.selectTWorkOrderById(orderId));
}
/**
* 新增工单基础信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:add')")
@Log(title = "工单基础信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder)
{
return toAjax(tWorkOrderService.insertTWorkOrder(tWorkOrder));
}
/**
* 修改工单基础信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:edit')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder) throws Exception {
String orderStatus = tWorkOrder.getOrderStatus();
// 工单状态只有是0未下发或1已下发,才允许修改
if(!"0".equals(orderStatus) && !"1".equals(orderStatus)){
throw new Exception(StringUtils.format("工单({})当前状态不允许修改。", tWorkOrder.getOrderId()));
}
return toAjax(tWorkOrderService.updateTWorkOrder(tWorkOrder));
}
/**
* 修改工单状态
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:editStatus')")
@Log(title = "工单基础信息", businessType = BusinessType.UPDATE)
@PutMapping("/editStatus")
public AjaxResult editStatus(@RequestBody TWorkOrder tWorkOrder) throws Exception {
String orderStatus = tWorkOrder.getOrderStatus();
if("5".equals(orderStatus)) {
throw new Exception(StringUtils.format("工单({})已归档,不允许更改状态。", tWorkOrder.getOrderId()));
}
return AjaxResult.success();
}
/**
* 删除工单基础信息
*/
@PreAuthorize("@ss.hasPermi('workOrder:basicsInfo:remove')")
@Log(title = "工单基础信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{orderIds}")
public AjaxResult remove(@PathVariable String[] orderIds)
{
return toAjax(tWorkOrderService.deleteTWorkOrderByIds(orderIds));
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 工单反馈信息对象 t_order_feedback
*
* @author zehong
* @date 2021-07-19
*/
public class TOrderFeedback extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工单反馈id */
private Long feedbackId;
/** 工单id */
@Excel(name = "工单id")
private String orderId;
/** 设备id */
@Excel(name = "设备id")
private Long deviceId;
/** 反馈内容 */
@Excel(name = "反馈内容")
private String contents;
/** 反馈时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "反馈时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date feedbackTime;
/** 是否存在隐患(0正常,1存在隐患) */
@Excel(name = "是否存在隐患", readConverterExp = "0=正常,1存在隐患")
private String isHiddenDanger;
/** 处理状态(1不需处理,2已处理完成,3未处理完成) */
@Excel(name = "处理状态", readConverterExp = "1=不需处理,2已处理完成,3未处理完成")
private String dealStatus;
/** 图片地址1 */
@Excel(name = "图片地址1")
private String pictureUrl1;
/** 图片地址2 */
@Excel(name = "图片地址2")
private String pictureUrl2;
/** 图片地址3 */
@Excel(name = "图片地址3")
private String pictureUrl3;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setFeedbackId(Long feedbackId)
{
this.feedbackId = feedbackId;
}
public Long getFeedbackId()
{
return feedbackId;
}
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setDeviceId(Long deviceId)
{
this.deviceId = deviceId;
}
public Long getDeviceId()
{
return deviceId;
}
public void setContents(String contents)
{
this.contents = contents;
}
public String getContents()
{
return contents;
}
public void setFeedbackTime(Date feedbackTime)
{
this.feedbackTime = feedbackTime;
}
public Date getFeedbackTime()
{
return feedbackTime;
}
public void setIsHiddenDanger(String isHiddenDanger)
{
this.isHiddenDanger = isHiddenDanger;
}
public String getIsHiddenDanger()
{
return isHiddenDanger;
}
public void setDealStatus(String dealStatus)
{
this.dealStatus = dealStatus;
}
public String getDealStatus()
{
return dealStatus;
}
public void setPictureUrl1(String pictureUrl1)
{
this.pictureUrl1 = pictureUrl1;
}
public String getPictureUrl1()
{
return pictureUrl1;
}
public void setPictureUrl2(String pictureUrl2)
{
this.pictureUrl2 = pictureUrl2;
}
public String getPictureUrl2()
{
return pictureUrl2;
}
public void setPictureUrl3(String pictureUrl3)
{
this.pictureUrl3 = pictureUrl3;
}
public String getPictureUrl3()
{
return pictureUrl3;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("feedbackId", getFeedbackId())
.append("orderId", getOrderId())
.append("deviceId", getDeviceId())
.append("contents", getContents())
.append("feedbackTime", getFeedbackTime())
.append("isHiddenDanger", getIsHiddenDanger())
.append("dealStatus", getDealStatus())
.append("pictureUrl1", getPictureUrl1())
.append("pictureUrl2", getPictureUrl2())
.append("pictureUrl3", getPictureUrl3())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 工单基础信息对象 t_work_order
*
* @author zehong
* @date 2021-07-19
*/
public class TWorkOrder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 工单id */
private String orderId;
/** 工单类型(1巡检信息,2隐患信息,3报警信息) */
@Excel(name = "工单类型", readConverterExp = "1=巡检信息,2隐患信息,3报警信息")
private String orderType;
/** 源id */
@Excel(name = "源id")
private Long resourceId;
/** 工单名称 */
@Excel(name = "工单名称")
private String orderName;
/** 工单状态(0未下发,1已下发,2已接受,3进行中,4已反馈,5已归档) */
@Excel(name = "工单状态", readConverterExp = "0=未下发,1已下发,2已接受,3进行中,4已反馈,5已归档")
private String orderStatus;
/** 指定执行人员(巡检员id) */
@Excel(name = "指定执行人员", readConverterExp = "巡检员id")
private Long appointInspector;
/** 下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "下发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date allotTime;
/** 实际接收人员(巡检员id) */
@Excel(name = "实际接收人员", readConverterExp = "巡检员id")
private Long actualInspector;
/** 实际接收时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实际接收时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date actualTime;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setOrderId(String orderId)
{
this.orderId = orderId;
}
public String getOrderId()
{
return orderId;
}
public void setOrderType(String orderType)
{
this.orderType = orderType;
}
public String getOrderType()
{
return orderType;
}
public Long getResourceId() {
return resourceId;
}
public void setResourceId(Long resourceId) {
this.resourceId = resourceId;
}
public void setOrderName(String orderName)
{
this.orderName = orderName;
}
public String getOrderName()
{
return orderName;
}
public void setOrderStatus(String orderStatus)
{
this.orderStatus = orderStatus;
}
public String getOrderStatus()
{
return orderStatus;
}
public void setAppointInspector(Long appointInspector)
{
this.appointInspector = appointInspector;
}
public Long getAppointInspector()
{
return appointInspector;
}
public void setAllotTime(Date allotTime)
{
this.allotTime = allotTime;
}
public Date getAllotTime()
{
return allotTime;
}
public void setActualInspector(Long actualInspector)
{
this.actualInspector = actualInspector;
}
public Long getActualInspector()
{
return actualInspector;
}
public void setActualTime(Date actualTime)
{
this.actualTime = actualTime;
}
public Date getActualTime()
{
return actualTime;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("orderId", getOrderId())
.append("orderType", getOrderType())
.append("orderName", getOrderName())
.append("orderStatus", getOrderStatus())
.append("createTime", getCreateTime())
.append("appointInspector", getAppointInspector())
.append("allotTime", getAllotTime())
.append("actualInspector", getActualInspector())
.append("actualTime", getActualTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TOrderFeedback;
/**
* 工单反馈信息Mapper接口
*
* @author zehong
* @date 2021-07-19
*/
public interface TOrderFeedbackMapper
{
/**
* 查询工单反馈信息
*
* @param feedbackId 工单反馈信息ID
* @return 工单反馈信息
*/
public TOrderFeedback selectTOrderFeedbackById(Long feedbackId);
/**
* 查询工单反馈信息列表
*
* @param tOrderFeedback 工单反馈信息
* @return 工单反馈信息集合
*/
public List<TOrderFeedback> selectTOrderFeedbackList(TOrderFeedback tOrderFeedback);
/**
* 新增工单反馈信息
*
* @param tOrderFeedback 工单反馈信息
* @return 结果
*/
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback);
/**
* 修改工单反馈信息
*
* @param tOrderFeedback 工单反馈信息
* @return 结果
*/
public int updateTOrderFeedback(TOrderFeedback tOrderFeedback);
/**
* 删除工单反馈信息
*
* @param feedbackId 工单反馈信息ID
* @return 结果
*/
public int deleteTOrderFeedbackById(Long feedbackId);
/**
* 批量删除工单反馈信息
*
* @param feedbackIds 需要删除的数据ID
* @return 结果
*/
public int deleteTOrderFeedbackByIds(Long[] feedbackIds);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TWorkOrder;
/**
* 工单基础信息Mapper接口
*
* @author zehong
* @date 2021-07-19
*/
public interface TWorkOrderMapper
{
/**
* 获取工单基础信息id
*
* @return 工单基础信息id
*/
public String getWorkOrderId();
/**
* 查询工单基础信息
*
* @param orderId 工单基础信息ID
* @return 工单基础信息
*/
public TWorkOrder selectTWorkOrderById(String orderId);
/**
* 查询工单基础信息列表
*
* @param tWorkOrder 工单基础信息
* @return 工单基础信息集合
*/
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder);
/**
* 新增工单基础信息
*
* @param tWorkOrder 工单基础信息
* @return 结果
*/
public int insertTWorkOrder(TWorkOrder tWorkOrder);
/**
* 修改工单基础信息
*
* @param tWorkOrder 工单基础信息
* @return 结果
*/
public int updateTWorkOrder(TWorkOrder tWorkOrder);
/**
* 删除工单基础信息
*
* @param orderId 工单基础信息ID
* @return 结果
*/
public int deleteTWorkOrderById(String orderId);
/**
* 批量删除工单基础信息
*
* @param orderIds 需要删除的数据ID
* @return 结果
*/
public int deleteTWorkOrderByIds(String[] orderIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TOrderFeedback;
/**
* 工单反馈信息Service接口
*
* @author zehong
* @date 2021-07-19
*/
public interface ITOrderFeedbackService
{
/**
* 查询工单反馈信息
*
* @param feedbackId 工单反馈信息ID
* @return 工单反馈信息
*/
public TOrderFeedback selectTOrderFeedbackById(Long feedbackId);
/**
* 查询工单反馈信息列表
*
* @param tOrderFeedback 工单反馈信息
* @return 工单反馈信息集合
*/
public List<TOrderFeedback> selectTOrderFeedbackList(TOrderFeedback tOrderFeedback);
/**
* 新增工单反馈信息
*
* @param tOrderFeedback 工单反馈信息
* @return 结果
*/
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback);
/**
* 修改工单反馈信息
*
* @param tOrderFeedback 工单反馈信息
* @return 结果
*/
public int updateTOrderFeedback(TOrderFeedback tOrderFeedback);
/**
* 批量删除工单反馈信息
*
* @param feedbackIds 需要删除的工单反馈信息ID
* @return 结果
*/
public int deleteTOrderFeedbackByIds(Long[] feedbackIds);
/**
* 删除工单反馈信息信息
*
* @param feedbackId 工单反馈信息ID
* @return 结果
*/
public int deleteTOrderFeedbackById(Long feedbackId);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TWorkOrder;
/**
* 工单基础信息Service接口
*
* @author zehong
* @date 2021-07-19
*/
public interface ITWorkOrderService
{
/**
* 获取工单基础信息id
*
* @return 工单基础信息id
*/
public String getWorkOrderId();
/**
* 查询工单基础信息
*
* @param orderId 工单基础信息ID
* @return 工单基础信息
*/
public TWorkOrder selectTWorkOrderById(String orderId);
/**
* 查询工单基础信息列表
*
* @param tWorkOrder 工单基础信息
* @return 工单基础信息集合
*/
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder);
/**
* 新增工单基础信息
*
* @param tWorkOrder 工单基础信息
* @return 结果
*/
public int insertTWorkOrder(TWorkOrder tWorkOrder);
/**
* 修改工单基础信息
*
* @param tWorkOrder 工单基础信息
* @return 结果
*/
public int updateTWorkOrder(TWorkOrder tWorkOrder) throws Exception;
/**
* 批量删除工单基础信息
*
* @param orderIds 需要删除的工单基础信息ID
* @return 结果
*/
public int deleteTWorkOrderByIds(String[] orderIds);
/**
* 删除工单基础信息信息
*
* @param orderId 工单基础信息ID
* @return 结果
*/
public int deleteTWorkOrderById(String orderId);
}
package com.zehong.system.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TOrderFeedbackMapper;
import com.zehong.system.domain.TOrderFeedback;
import com.zehong.system.service.ITOrderFeedbackService;
/**
* 工单反馈信息Service业务层处理
*
* @author zehong
* @date 2021-07-19
*/
@Service
public class TOrderFeedbackServiceImpl implements ITOrderFeedbackService
{
@Autowired
private TOrderFeedbackMapper tOrderFeedbackMapper;
/**
* 查询工单反馈信息
*
* @param feedbackId 工单反馈信息ID
* @return 工单反馈信息
*/
@Override
public TOrderFeedback selectTOrderFeedbackById(Long feedbackId)
{
return tOrderFeedbackMapper.selectTOrderFeedbackById(feedbackId);
}
/**
* 查询工单反馈信息列表
*
* @param tOrderFeedback 工单反馈信息
* @return 工单反馈信息
*/
@Override
public List<TOrderFeedback> selectTOrderFeedbackList(TOrderFeedback tOrderFeedback)
{
return tOrderFeedbackMapper.selectTOrderFeedbackList(tOrderFeedback);
}
/**
* 新增工单反馈信息
*
* @param tOrderFeedback 工单反馈信息
* @return 结果
*/
@Override
public int insertTOrderFeedback(TOrderFeedback tOrderFeedback)
{
return tOrderFeedbackMapper.insertTOrderFeedback(tOrderFeedback);
}
/**
* 修改工单反馈信息
*
* @param tOrderFeedback 工单反馈信息
* @return 结果
*/
@Override
public int updateTOrderFeedback(TOrderFeedback tOrderFeedback)
{
return tOrderFeedbackMapper.updateTOrderFeedback(tOrderFeedback);
}
/**
* 批量删除工单反馈信息
*
* @param feedbackIds 需要删除的工单反馈信息ID
* @return 结果
*/
@Override
public int deleteTOrderFeedbackByIds(Long[] feedbackIds)
{
return tOrderFeedbackMapper.deleteTOrderFeedbackByIds(feedbackIds);
}
/**
* 删除工单反馈信息信息
*
* @param feedbackId 工单反馈信息ID
* @return 结果
*/
@Override
public int deleteTOrderFeedbackById(Long feedbackId)
{
return tOrderFeedbackMapper.deleteTOrderFeedbackById(feedbackId);
}
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.ExceptionUtil;
import com.zehong.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TWorkOrderMapper;
import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.service.ITWorkOrderService;
/**
* 工单基础信息Service业务层处理
*
* @author zehong
* @date 2021-07-19
*/
@Service
public class TWorkOrderServiceImpl implements ITWorkOrderService
{
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
/**
* 获取工单基础信息id
*
* @return 工单基础信息id
*/
@Override
public String getWorkOrderId()
{
return tWorkOrderMapper.getWorkOrderId();
}
/**
* 查询工单基础信息
*
* @param orderId 工单基础信息ID
* @return 工单基础信息
*/
@Override
public TWorkOrder selectTWorkOrderById(String orderId)
{
return tWorkOrderMapper.selectTWorkOrderById(orderId);
}
/**
* 查询工单基础信息列表
*
* @param tWorkOrder 工单基础信息
* @return 工单基础信息
*/
@Override
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder)
{
return tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
}
/**
* 新增工单基础信息
*
* @param tWorkOrder 工单基础信息
* @return 结果
*/
@Override
public int insertTWorkOrder(TWorkOrder tWorkOrder)
{
String orderId = tWorkOrderMapper.getWorkOrderId();
tWorkOrder.setOrderId(orderId);
tWorkOrder.setCreateTime(DateUtils.getNowDate());
return tWorkOrderMapper.insertTWorkOrder(tWorkOrder);
}
/**
* 修改工单基础信息
*
* @param tWorkOrder 工单基础信息
* @return 结果
*/
@Override
public int updateTWorkOrder(TWorkOrder tWorkOrder)
{
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
}
/**
* 批量删除工单基础信息
*
* @param orderIds 需要删除的工单基础信息ID
* @return 结果
*/
@Override
public int deleteTWorkOrderByIds(String[] orderIds)
{
return tWorkOrderMapper.deleteTWorkOrderByIds(orderIds);
}
/**
* 删除工单基础信息信息
*
* @param orderId 工单基础信息ID
* @return 结果
*/
@Override
public int deleteTWorkOrderById(String orderId)
{
return tWorkOrderMapper.deleteTWorkOrderById(orderId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TOrderFeedbackMapper">
<resultMap type="TOrderFeedback" id="TOrderFeedbackResult">
<result property="feedbackId" column="feedback_id" />
<result property="orderId" column="order_id" />
<result property="deviceId" column="device_id" />
<result property="contents" column="contents" />
<result property="feedbackTime" column="feedback_time" />
<result property="isHiddenDanger" column="is_hidden_danger" />
<result property="dealStatus" column="deal_status" />
<result property="pictureUrl1" column="picture_url_1" />
<result property="pictureUrl2" column="picture_url_2" />
<result property="pictureUrl3" column="picture_url_3" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTOrderFeedbackVo">
select feedback_id, order_id, device_id, contents, feedback_time, is_hidden_danger, deal_status, picture_url_1, picture_url_2, picture_url_3, remarks from t_order_feedback
</sql>
<select id="selectTOrderFeedbackList" parameterType="TOrderFeedback" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/>
<where>
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
<if test="deviceId != null "> and device_id = #{deviceId}</if>
<if test="contents != null and contents != ''"> and contents = #{contents}</if>
<if test="feedbackTime != null "> and feedback_time = #{feedbackTime}</if>
<if test="isHiddenDanger != null and isHiddenDanger != ''"> and is_hidden_danger = #{isHiddenDanger}</if>
<if test="dealStatus != null and dealStatus != ''"> and deal_status = #{dealStatus}</if>
<if test="pictureUrl1 != null and pictureUrl1 != ''"> and picture_url_1 = #{pictureUrl1}</if>
<if test="pictureUrl2 != null and pictureUrl2 != ''"> and picture_url_2 = #{pictureUrl2}</if>
<if test="pictureUrl3 != null and pictureUrl3 != ''"> and picture_url_3 = #{pictureUrl3}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTOrderFeedbackById" parameterType="Long" resultMap="TOrderFeedbackResult">
<include refid="selectTOrderFeedbackVo"/>
where feedback_id = #{feedbackId}
</select>
<insert id="insertTOrderFeedback" parameterType="TOrderFeedback">
insert into t_order_feedback
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="feedbackId != null">feedback_id,</if>
<if test="orderId != null">order_id,</if>
<if test="deviceId != null">device_id,</if>
<if test="contents != null">contents,</if>
<if test="feedbackTime != null">feedback_time,</if>
<if test="isHiddenDanger != null">is_hidden_danger,</if>
<if test="dealStatus != null">deal_status,</if>
<if test="pictureUrl1 != null">picture_url_1,</if>
<if test="pictureUrl2 != null">picture_url_2,</if>
<if test="pictureUrl3 != null">picture_url_3,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="feedbackId != null">#{feedbackId},</if>
<if test="orderId != null">#{orderId},</if>
<if test="deviceId != null">#{deviceId},</if>
<if test="contents != null">#{contents},</if>
<if test="feedbackTime != null">#{feedbackTime},</if>
<if test="isHiddenDanger != null">#{isHiddenDanger},</if>
<if test="dealStatus != null">#{dealStatus},</if>
<if test="pictureUrl1 != null">#{pictureUrl1},</if>
<if test="pictureUrl2 != null">#{pictureUrl2},</if>
<if test="pictureUrl3 != null">#{pictureUrl3},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTOrderFeedback" parameterType="TOrderFeedback">
update t_order_feedback
<trim prefix="SET" suffixOverrides=",">
<if test="orderId != null">order_id = #{orderId},</if>
<if test="deviceId != null">device_id = #{deviceId},</if>
<if test="contents != null">contents = #{contents},</if>
<if test="feedbackTime != null">feedback_time = #{feedbackTime},</if>
<if test="isHiddenDanger != null">is_hidden_danger = #{isHiddenDanger},</if>
<if test="dealStatus != null">deal_status = #{dealStatus},</if>
<if test="pictureUrl1 != null">picture_url_1 = #{pictureUrl1},</if>
<if test="pictureUrl2 != null">picture_url_2 = #{pictureUrl2},</if>
<if test="pictureUrl3 != null">picture_url_3 = #{pictureUrl3},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where feedback_id = #{feedbackId}
</update>
<delete id="deleteTOrderFeedbackById" parameterType="Long">
delete from t_order_feedback where feedback_id = #{feedbackId}
</delete>
<delete id="deleteTOrderFeedbackByIds" parameterType="String">
delete from t_order_feedback where feedback_id in
<foreach item="feedbackId" collection="array" open="(" separator="," close=")">
#{feedbackId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TWorkOrderMapper">
<resultMap type="TWorkOrder" id="TWorkOrderResult">
<result property="orderId" column="order_id" />
<result property="orderType" column="order_type" />
<result property="resourceId" column="resource_id" />
<result property="orderName" column="order_name" />
<result property="orderStatus" column="order_status" />
<result property="createTime" column="create_time" />
<result property="appointInspector" column="appoint_inspector" />
<result property="allotTime" column="allot_time" />
<result property="actualInspector" column="actual_inspector" />
<result property="actualTime" column="actual_time" />
<result property="remarks" column="remarks" />
</resultMap>
<select id="getWorkOrderId" resultType="String">
select nextval('seq_work_order_id') as id
</select>
<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
</sql>
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/>
<where>
<if test="orderType != null and orderType != ''"> and order_type = #{orderType}</if>
<if test="orderName != null and orderName != ''"> and order_name like concat('%', #{orderName}, '%')</if>
<if test="orderStatus != null and orderStatus != ''"> and order_status = #{orderStatus}</if>
<if test="appointInspector != null "> and appoint_inspector = #{appointInspector}</if>
<if test="allotTime != null "> and allot_time = #{allotTime}</if>
<if test="actualInspector != null "> and actual_inspector = #{actualInspector}</if>
<if test="actualTime != null "> and actual_time = #{actualTime}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTWorkOrderById" parameterType="String" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/>
where order_id = #{orderId}
</select>
<insert id="insertTWorkOrder" parameterType="TWorkOrder">
insert into t_work_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderId != null">order_id,</if>
<if test="orderType != null">order_type,</if>
<if test="resourceId != null">resource_id,</if>
<if test="orderName != null">order_name,</if>
<if test="orderStatus != null">order_status,</if>
<if test="createTime != null">create_time,</if>
<if test="appointInspector != null">appoint_inspector,</if>
<if test="allotTime != null">allot_time,</if>
<if test="actualInspector != null">actual_inspector,</if>
<if test="actualTime != null">actual_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderId != null">#{orderId},</if>
<if test="orderType != null">#{orderType},</if>
<if test="resourceId != null">#{resourceId},</if>
<if test="orderName != null">#{orderName},</if>
<if test="orderStatus != null">#{orderStatus},</if>
<if test="createTime != null">#{createTime},</if>
<if test="appointInspector != null">#{appointInspector},</if>
<if test="allotTime != null">#{allotTime},</if>
<if test="actualInspector != null">#{actualInspector},</if>
<if test="actualTime != null">#{actualTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTWorkOrder" parameterType="TWorkOrder">
update t_work_order
<trim prefix="SET" suffixOverrides=",">
<if test="orderType != null">order_type = #{orderType},</if>
<if test="orderName != null">order_name = #{orderName},</if>
<if test="orderStatus != null">order_status = #{orderStatus},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="appointInspector != null">appoint_inspector = #{appointInspector},</if>
<if test="allotTime != null">allot_time = #{allotTime},</if>
<if test="actualInspector != null">actual_inspector = #{actualInspector},</if>
<if test="actualTime != null">actual_time = #{actualTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where order_id = #{orderId}
</update>
<delete id="deleteTWorkOrderById" parameterType="String">
delete from t_work_order where order_id = #{orderId}
</delete>
<delete id="deleteTWorkOrderByIds" parameterType="String">
delete from t_work_order where order_id in
<foreach item="orderId" collection="array" open="(" separator="," close=")">
#{orderId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询工单基础信息列表
export function listBasicsInfo(query) {
return request({
url: '/workOrder/basicsInfo/list',
method: 'get',
params: query
})
}
// 查询工单基础信息详细
export function getBasicsInfo(orderId) {
return request({
url: '/workOrder/basicsInfo/' + orderId,
method: 'get'
})
}
// 新增工单基础信息
export function addBasicsInfo(data) {
return request({
url: '/workOrder/basicsInfo',
method: 'post',
data: data
})
}
// 修改工单基础信息
export function updateBasicsInfo(data) {
return request({
url: '/workOrder/basicsInfo',
method: 'put',
data: data
})
}
// 修改工单状态
export function updateOrderStatus(data) {
return request({
url: '/workOrder/basicsInfo/editStatus',
method: 'put',
data: data
})
}
// 删除工单基础信息
export function delBasicsInfo(orderId) {
return request({
url: '/workOrder/basicsInfo/' + orderId,
method: 'delete'
})
}
// 导出工单基础信息
export function exportBasicsInfo(query) {
return request({
url: '/workOrder/basicsInfo/export',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询工单反馈信息列表
export function listFeedback(query) {
return request({
url: '/workOrder/feedback/list',
method: 'get',
params: query
})
}
// 查询工单反馈信息详细
export function getFeedback(feedbackId) {
return request({
url: '/workOrder/feedback/' + feedbackId,
method: 'get'
})
}
// 新增工单反馈信息
export function addFeedback(data) {
return request({
url: '/workOrder/feedback',
method: 'post',
data: data
})
}
// 修改工单反馈信息
export function updateFeedback(data) {
return request({
url: '/workOrder/feedback',
method: 'put',
data: data
})
}
// 删除工单反馈信息
export function delFeedback(feedbackId) {
return request({
url: '/workOrder/feedback/' + feedbackId,
method: 'delete'
})
}
// 导出工单反馈信息
export function exportFeedback(query) {
return request({
url: '/workOrder/feedback/export',
method: 'get',
params: query
})
}
\ No newline at end of file
<template>
<div class="mapwrap">
<el-dialog
title="拾取坐标"
:visible.sync="dialogTableVisible"
:show-close="false"
:close-on-click-modal="false"
id="mapcnt"
>
<el-row class="lt">
经纬度:
<el-input
placeholder="经度"
v-model.number="lnglat.lng"
type="number"
></el-input>
<el-input
placeholder="纬度"
v-model.number="lnglat.lat"
type="number"
></el-input>
<el-button type="primary" size="small" @click="confirmFun"
>确定</el-button
>
<el-button size="small" @click="$emit('dialogcancelFun')"
>取消</el-button
>
</el-row>
<el-row>
<div id="mapContainer">
<Search :MAP="MAP" :Mutil="Mutil" v-if="mapLoadDone"></Search>
</div>
</el-row>
</el-dialog>
</div>
</template>
<script>
import Search from '@/components/Maplnglat/search.vue';
import Mutil from '@/utils/mapUtil.js';
import { toLonLat } from "ol/proj";
export default {
components: {
Search
},
data() {
return {
MAP: Object,
Mutil: Object,
mapLoadDone: false,
slat: 0,
slng: 0,
dialogTableVisible: false,
zoom: 12,
lnglat: {
lng: 0,
lat: 0,
}
}
},
methods: {
mapClick() {
let that = this;
that.MAP.on("click", function (evt) {
let lnglat = toLonLat(evt.coordinate);
that.Mutil.removeSearchm("pickLngLat");
that.Mutil.addMarkerToMap(
"pickLngLat",
"",
require(""),
lnglat,
0.5
);
that.lnglat.lng = Number(lnglat[0].toPrecision(10));
that.lnglat.lat = Number(lnglat[1].toPrecision(10));
});
},
confirmFun() {
this.$emit("dialogcancelFun");
this.$emit("confirm", {
lng: this.lnglat.lng,
lat: this.lnglat.lat,
});
},
cancel() {
},
mounted() {
let that = this;
that.$nextTick(() => {
that.Mutil = new Mutil("mapContainer");
that.MAP = that.Mutil.MAP;
that.mapLoadDone = true;
if (typeof that.slng == "number" && that.slng != 0) {
that.lnglat.lng = that.slng;
that.lnglat.lat = that.slat;
that.Mutil.addMarkerToMap(
"pickLngLat",
"",
require("@/assets/mark/pk.png"),
[that.slng, that.slat],
0.5
);
that.Mutil.setViewF({
center: [that.slng, that.slat],
zoom: 16,
});
}
that.mapClick();
});
}
}
}
</script>
<style lang="scss">
#mapcnt .el-dialog {
width: 90% !important;
}
.el-cascader {
width: 100%;
}
.lt .el-input {
width: 180px;
margin-right: 15px;
display: inline-block;
}
#mapContainer {
width: 100%;
height: 450px;
position: relative;
margin-top: 10px;
overflow: hidden;
}
.el-vue-amap-container {
width: 100%;
height: 100%;
}
.search-box {
position: absolute !important;
top: 10px;
left: 10px;
}
#searchbar input {
padding: 5px;
border: 1px solid royalblue;
border-radius: 5px;
min-width: 150px;
}
</style>
<template>
<div>
<div class="funBox">
<div class="funBox-item ser">
<input type="text" placeholder="输入地址" v-model="serVal" /><button @click="mapSearch()"></button>
<div class="serTip" v-if="tipsShow">
<div class="aimAdone">
<p>您可以尝试:</p>
<p>1、检查输入是否正确</p>
<p>2、输入其他关键字进行搜索</p>
</div>
</div>
<!-- 目标地点 -->
<div class="serTip" v-if="aimAdrsArr.length > 0">
<div v-for="(i, inde) in aimAdrsArr" :key="inde" class="aimAdone" @click="mapSetView(i.lonlat)">
<p>{{ inde + 1 + ". " + i.name }}</p>
<p class="grey">地址:{{ i.address }}</p>
</div>
</div>
<div class="serTip" v-if="serTipArr.length > 0">
<!-- 建议地点 -->
<ul>
<li v-for="(i, ind) in serTipArr" :key="ind" @click="toAimAdress(i.name)">
{{ i.name }}<span class="addressTxt">{{ i.address }}</span>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
<script>
import {
fromLonLat,
toLonLat
} from "ol/proj";
import axios from "axios";
export default {
name: "search",
components: {
},
data() {
return {
MAP: Object,
Mutil: Object,
serVal: "",
mapStyleArr: [{
key: "gooleSatellite",
word: "谷歌卫星地图",
},
{
key: "amapSatellite",
word: "高德卫星地图",
},
{
key: "amapCity",
word: "高德城市地图",
},
],
serTipArr: [],
aimAdrsArr: [],
actInde: 0,
tipsShow: false,
}
},
watch: {
serVal(newVal){
if (newVal == "") {
this.Mutil.removeSearchm('searchM');
this.tipsShow = false;
this.serTipArr = [];
return;
}
this.searchFun("4", newVal);
}
},
methods: {
searchFun(type, newVal) {
let that = this,
url = "http://api.tianditu.gov.cn/search";
that.serTipArr = [];
that.aimAdrsArr = [];
that.tipsShow = false;
axios
.get(url, {
params: {
type: "query",
postStr: {
// specifyAdminCode: "130100000000",
keyWord: newVal,
mapBound: "114.34193,37.92687,114.63753,38.16345",
level: "12",
queryType: type, //4:普通建议词搜索, 1:普通搜索,
start: "0",
count: 10,
},
tk: "c8df739f047ce17cfe41b63cbeae6997",
},
})
.then((res) => {
if (type == 4 && res.status == 200) {
if (res.data.suggests) {
that.tipsShow = false;
let {
suggests: tipsData
} = res.data;
that.serTipArr = tipsData;
} else {
that.serTipArr = [];
that.tipsShow = true;
}
}
if (type == 1 && res.status == 200) {
if (res.data.pois) {
that.tipsShow = false;
let {
pois: aimsData
} = res.data;
that.aimAdrsArr = aimsData;
that.Mutil.removeSearchm('searchM');
//标注到地图
that.aimAdrsArr.forEach((ele, inde) => {
let lnglat = ele.lonlat.split(" ");
that.Mutil.addMarkerToMap(
'searchM',
ele.name,
require("@/assets/mark/pick.png"),
[Number(lnglat[0]), Number(lnglat[1])],
0.5
);
if (inde == 0) {
that.MAP.getView().animate({
center: fromLonLat([Number(lnglat[0]), Number(lnglat[1])]),
zoom: 17,
duration: 1000,
});
}
});
} else {
that.aimAdrsArr = [];
that.tipsShow = true;
}
}
})
.catch((err) => {
that.$message.error(err);
});
},
mapSetView(lnglat) {
let that = this,
lonlat = lnglat.split(" ");
that.MAP.getView().animate({
center: fromLonLat([Number(lonlat[0]), Number(lonlat[1])]),
zoom: 17,
duration: 1000,
});
},
mapSearch() {
let that = this,
url = "https://restapi.amap.com/v3/place/text";
that.$axios
.get(
url +
`?key=a827e19b0efcc8bf58afb4f23de188d9&keywords=${that.serVal}?city='河北省'`
)
.then((res) => {
console.log(res);
})
.catch((err) => console.log(err));
},
toAimAdress(name) {
this.serTipArr = [];
this.searchFun("1", name);
},
changeMapStyle(inde) {
let that = this,
arr = [0, 1, 2, 3];
console.log(inde);
arr.forEach((ele) => {
if (ele != inde) that.MAP.getLayers().getArray()[ele].setVisible(false);
});
that.MAP.getLayers().getArray()[inde].setVisible(true);
},
},
created(){},
}
</script>
<style>
.funBox {
position: absolute;
top: 10px;
left: 41px;
z-index: 2;
}
.funBox-item {
float: left;
background: #fff;
padding: 5px;
}
.funBox .ser {
width: 265px;
height: 45px;
box-sizing: border-box;
z-index: 2202;
border-radius: 2px;
position: relative;
}
.funBox .ser input {
position: absolute;
top: 12.5px;
box-sizing: border-box;
text-indent: 2px;
z-index: 2200;
border: none;
width: 219px;
height: 20px;
line-height: 20px;
padding: 0;
letter-spacing: 0.5px;
font-size: 14px;
}
.funBox .ser input:focus {
border: none;
outline: none;
}
.funBox button {
background: url("https://g.csdnimg.cn/common/csdn-toolbar/images/csdn-black-search.png") no-repeat center;
background-size: 80%;
position: absolute;
right: 0;
top: 0;
z-index: 9308;
box-sizing: border-box;
width: 45px;
height: 45px;
outline: none;
border: none;
border-left: #eee 1px solid;
}
.funBox .btn {
line-height: 25px;
padding: 10px 8px;
border-right: #afc5ee 1px dashed;
font-size: 14px;
cursor: pointer;
}
.funBox .btn:last-child {
border: none;
}
.serTip {
overflow: hidden;
position: absolute;
top: 47px;
left: 0;
width: 100%;
height: auto;
z-index: 9;
background: #fff;
}
.serTip ul {
margin: 0;
padding: 0;
}
.serTip li {
line-height: 2;
list-style: none;
font-size: 14px;
color: black;
padding: 0 10px;
width: 100%;
overflow: hidden;
height: 2em;
cursor: pointer;
}
.serTip li:hover {
background: #eee;
}
.aimAdone {
padding: 0 10px;
cursor: pointer;
}
.aimAdone:hover {
background: burlywood;
}
.addressTxt {
margin-left: 10px;
margin-right: 5px;
color: #999;
font-size: 12px;
}
.grey {
font-size: 12px;
color: #999;
}
.atc {
color: blue;
}
</style>
This diff is collapsed.
This diff is collapsed.
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