Commit 598fa7bc authored by 耿迪迪's avatar 耿迪迪

任务下发 gengdidi

parent 68ce73e2
package com.zehong.web.controller.operationMonitor;
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.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 2022-02-10
*/
@RestController
@RequestMapping("/system/order")
public class TWorkOrderController extends BaseController
{
@Autowired
private ITWorkOrderService tWorkOrderService;
/**
* 查询燃气任务列表
*/
@PreAuthorize("@ss.hasPermi('system:order:list')")
@GetMapping("/list")
public TableDataInfo list(TWorkOrder tWorkOrder)
{
startPage();
List<TWorkOrder> list = tWorkOrderService.selectTWorkOrderList(tWorkOrder);
return getDataTable(list);
}
/**
* 导出燃气任务列表
*/
@PreAuthorize("@ss.hasPermi('system:order: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('system:order:query')")
@GetMapping(value = "/{workId}")
public AjaxResult getInfo(@PathVariable("workId") Long workId)
{
return AjaxResult.success(tWorkOrderService.selectTWorkOrderById(workId));
}
/**
* 新增燃气任务
*/
@PreAuthorize("@ss.hasPermi('system:order:add')")
@Log(title = "燃气任务", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TWorkOrder tWorkOrder)
{
return toAjax(tWorkOrderService.insertTWorkOrder(tWorkOrder));
}
/**
* 修改燃气任务
*/
@PreAuthorize("@ss.hasPermi('system:order:edit')")
@Log(title = "燃气任务", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TWorkOrder tWorkOrder)
{
return toAjax(tWorkOrderService.updateTWorkOrder(tWorkOrder));
}
/**
* 删除燃气任务
*/
@PreAuthorize("@ss.hasPermi('system:order:remove')")
@Log(title = "燃气任务", businessType = BusinessType.DELETE)
@DeleteMapping("/{workIds}")
public AjaxResult remove(@PathVariable Long[] workIds)
{
return toAjax(tWorkOrderService.deleteTWorkOrderByIds(workIds));
}
}
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 2022-02-10
*/
public class TWorkOrder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 任务id */
private Long workId;
/** 任务标题 */
@Excel(name = "任务标题")
private String workTitle;
/** 任务类型:1.入户安检 2.巡检 3.报警巡查 4.其他 */
@Excel(name = "任务类型:1.入户安检 2.巡检 3.报警巡查 4.其他")
private String workType;
/** 任务内容 */
@Excel(name = "任务内容")
private String workContent;
/** 创建单位名称 */
@Excel(name = "创建单位名称")
private String workCreateEnterpriseName;
/** 创建单位id */
@Excel(name = "创建单位id")
private String workCreateEnterpriseId;
/** 指派单位名称 */
@Excel(name = "指派单位名称")
private String workAssignEnterproseName;
/** 指派单位id */
@Excel(name = "指派单位id")
private Long workAssignEnterproseId;
/** 指派人 */
@Excel(name = "指派人")
private Long workAssignManId;
/** 指派人id */
@Excel(name = "指派人id")
private String workAssignMan;
/** 任务状态:1.派发中 2.反馈 3.归档 */
@Excel(name = "任务状态:1.派发中 2.反馈 3.归档")
private String workStatus;
/** 巡检时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "巡检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectionDate;
/** 巡检路线 */
@Excel(name = "巡检路线")
private String inspectionRoute;
/** 问题描述 */
@Excel(name = "问题描述")
private String problemDescription;
/** 图片路径 */
@Excel(name = "图片路径")
private String iconUrl;
/** 整改方案 */
@Excel(name = "整改方案")
private String rectificationPlan;
/** 整改结果 */
@Excel(name = "整改结果")
private String rectificationResult;
/** 责任单位 */
@Excel(name = "责任单位")
private String responsibleUnit;
/** 责任人员 */
@Excel(name = "责任人员")
private String responsiblePerson;
/** 截止日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "截止日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date expiryDate;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setWorkId(Long workId)
{
this.workId = workId;
}
public Long getWorkId()
{
return workId;
}
public void setWorkTitle(String workTitle)
{
this.workTitle = workTitle;
}
public String getWorkTitle()
{
return workTitle;
}
public void setWorkType(String workType)
{
this.workType = workType;
}
public String getWorkType()
{
return workType;
}
public void setWorkContent(String workContent)
{
this.workContent = workContent;
}
public String getWorkContent()
{
return workContent;
}
public void setWorkCreateEnterpriseName(String workCreateEnterpriseName)
{
this.workCreateEnterpriseName = workCreateEnterpriseName;
}
public String getWorkCreateEnterpriseName()
{
return workCreateEnterpriseName;
}
public void setWorkCreateEnterpriseId(String workCreateEnterpriseId)
{
this.workCreateEnterpriseId = workCreateEnterpriseId;
}
public String getWorkCreateEnterpriseId()
{
return workCreateEnterpriseId;
}
public void setWorkAssignEnterproseName(String workAssignEnterproseName)
{
this.workAssignEnterproseName = workAssignEnterproseName;
}
public String getWorkAssignEnterproseName()
{
return workAssignEnterproseName;
}
public void setWorkAssignEnterproseId(Long workAssignEnterproseId)
{
this.workAssignEnterproseId = workAssignEnterproseId;
}
public Long getWorkAssignEnterproseId()
{
return workAssignEnterproseId;
}
public void setWorkAssignManId(Long workAssignManId)
{
this.workAssignManId = workAssignManId;
}
public Long getWorkAssignManId()
{
return workAssignManId;
}
public void setWorkAssignMan(String workAssignMan)
{
this.workAssignMan = workAssignMan;
}
public String getWorkAssignMan()
{
return workAssignMan;
}
public void setWorkStatus(String workStatus)
{
this.workStatus = workStatus;
}
public String getWorkStatus()
{
return workStatus;
}
public void setInspectionDate(Date inspectionDate)
{
this.inspectionDate = inspectionDate;
}
public Date getInspectionDate()
{
return inspectionDate;
}
public void setInspectionRoute(String inspectionRoute)
{
this.inspectionRoute = inspectionRoute;
}
public String getInspectionRoute()
{
return inspectionRoute;
}
public void setProblemDescription(String problemDescription)
{
this.problemDescription = problemDescription;
}
public String getProblemDescription()
{
return problemDescription;
}
public void setIconUrl(String iconUrl)
{
this.iconUrl = iconUrl;
}
public String getIconUrl()
{
return iconUrl;
}
public void setRectificationPlan(String rectificationPlan)
{
this.rectificationPlan = rectificationPlan;
}
public String getRectificationPlan()
{
return rectificationPlan;
}
public void setRectificationResult(String rectificationResult)
{
this.rectificationResult = rectificationResult;
}
public String getRectificationResult()
{
return rectificationResult;
}
public void setResponsibleUnit(String responsibleUnit)
{
this.responsibleUnit = responsibleUnit;
}
public String getResponsibleUnit()
{
return responsibleUnit;
}
public void setResponsiblePerson(String responsiblePerson)
{
this.responsiblePerson = responsiblePerson;
}
public String getResponsiblePerson()
{
return responsiblePerson;
}
public void setExpiryDate(Date expiryDate)
{
this.expiryDate = expiryDate;
}
public Date getExpiryDate()
{
return expiryDate;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
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("workId", getWorkId())
.append("workTitle", getWorkTitle())
.append("workType", getWorkType())
.append("workContent", getWorkContent())
.append("workCreateEnterpriseName", getWorkCreateEnterpriseName())
.append("workCreateEnterpriseId", getWorkCreateEnterpriseId())
.append("workAssignEnterproseName", getWorkAssignEnterproseName())
.append("workAssignEnterproseId", getWorkAssignEnterproseId())
.append("workAssignManId", getWorkAssignManId())
.append("workAssignMan", getWorkAssignMan())
.append("workStatus", getWorkStatus())
.append("inspectionDate", getInspectionDate())
.append("inspectionRoute", getInspectionRoute())
.append("problemDescription", getProblemDescription())
.append("iconUrl", getIconUrl())
.append("rectificationPlan", getRectificationPlan())
.append("rectificationResult", getRectificationResult())
.append("responsibleUnit", getResponsibleUnit())
.append("responsiblePerson", getResponsiblePerson())
.append("expiryDate", getExpiryDate())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TWorkOrder;
/**
* 燃气任务Mapper接口
*
* @author zehong
* @date 2022-02-10
*/
public interface TWorkOrderMapper
{
/**
* 查询燃气任务
*
* @param workId 燃气任务ID
* @return 燃气任务
*/
public TWorkOrder selectTWorkOrderById(Long workId);
/**
* 查询燃气任务列表
*
* @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 workId 燃气任务ID
* @return 结果
*/
public int deleteTWorkOrderById(Long workId);
/**
* 批量删除燃气任务
*
* @param workIds 需要删除的数据ID
* @return 结果
*/
public int deleteTWorkOrderByIds(Long[] workIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TWorkOrder;
/**
* 燃气任务Service接口
*
* @author zehong
* @date 2022-02-10
*/
public interface ITWorkOrderService
{
/**
* 查询燃气任务
*
* @param workId 燃气任务ID
* @return 燃气任务
*/
public TWorkOrder selectTWorkOrderById(Long workId);
/**
* 查询燃气任务列表
*
* @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 workIds 需要删除的燃气任务ID
* @return 结果
*/
public int deleteTWorkOrderByIds(Long[] workIds);
/**
* 删除燃气任务信息
*
* @param workId 燃气任务ID
* @return 结果
*/
public int deleteTWorkOrderById(Long workId);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
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 2022-02-10
*/
@Service
public class TWorkOrderServiceImpl implements ITWorkOrderService
{
@Autowired
private TWorkOrderMapper tWorkOrderMapper;
/**
* 查询燃气任务
*
* @param workId 燃气任务ID
* @return 燃气任务
*/
@Override
public TWorkOrder selectTWorkOrderById(Long workId)
{
return tWorkOrderMapper.selectTWorkOrderById(workId);
}
/**
* 查询燃气任务列表
*
* @param tWorkOrder 燃气任务
* @return 燃气任务
*/
@Override
public List<TWorkOrder> selectTWorkOrderList(TWorkOrder tWorkOrder)
{
return tWorkOrderMapper.selectTWorkOrderList(tWorkOrder);
}
/**
* 新增燃气任务
*
* @param tWorkOrder 燃气任务
* @return 结果
*/
@Override
public int insertTWorkOrder(TWorkOrder tWorkOrder)
{
tWorkOrder.setCreateTime(DateUtils.getNowDate());
return tWorkOrderMapper.insertTWorkOrder(tWorkOrder);
}
/**
* 修改燃气任务
*
* @param tWorkOrder 燃气任务
* @return 结果
*/
@Override
public int updateTWorkOrder(TWorkOrder tWorkOrder)
{
tWorkOrder.setUpdateTime(DateUtils.getNowDate());
return tWorkOrderMapper.updateTWorkOrder(tWorkOrder);
}
/**
* 批量删除燃气任务
*
* @param workIds 需要删除的燃气任务ID
* @return 结果
*/
@Override
public int deleteTWorkOrderByIds(Long[] workIds)
{
return tWorkOrderMapper.deleteTWorkOrderByIds(workIds);
}
/**
* 删除燃气任务信息
*
* @param workId 燃气任务ID
* @return 结果
*/
@Override
public int deleteTWorkOrderById(Long workId)
{
return tWorkOrderMapper.deleteTWorkOrderById(workId);
}
}
<?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="workId" column="work_id" />
<result property="workTitle" column="work_title" />
<result property="workType" column="work_type" />
<result property="workContent" column="work_content" />
<result property="workCreateEnterpriseName" column="work_create_enterprise_name" />
<result property="workCreateEnterpriseId" column="work_create_enterprise_id" />
<result property="workAssignEnterproseName" column="work_assign_enterprose_name" />
<result property="workAssignEnterproseId" column="work_assign_enterprose_id" />
<result property="workAssignManId" column="work_assign_man_id" />
<result property="workAssignMan" column="work_assign_man" />
<result property="workStatus" column="work_status" />
<result property="inspectionDate" column="inspection_date" />
<result property="inspectionRoute" column="inspection_route" />
<result property="problemDescription" column="problem_description" />
<result property="iconUrl" column="icon_url" />
<result property="rectificationPlan" column="rectification_plan" />
<result property="rectificationResult" column="rectification_result" />
<result property="responsibleUnit" column="responsible_unit" />
<result property="responsiblePerson" column="responsible_person" />
<result property="expiryDate" column="expiry_date" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTWorkOrderVo">
select work_id, work_title, work_type, work_content, work_create_enterprise_name, work_create_enterprise_id, work_assign_enterprose_name, work_assign_enterprose_id, work_assign_man_id, work_assign_man, work_status, inspection_date, inspection_route, problem_description, icon_url, rectification_plan, rectification_result, responsible_unit, responsible_person, expiry_date, create_by, create_time, update_by, update_time, is_del, remarks from t_work_order
</sql>
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/>
<where>
<if test="workTitle != null and workTitle != ''"> and work_title = #{workTitle}</if>
<if test="workType != null and workType != ''"> and work_type = #{workType}</if>
<if test="workContent != null and workContent != ''"> and work_content = #{workContent}</if>
<if test="workCreateEnterpriseName != null and workCreateEnterpriseName != ''"> and work_create_enterprise_name like concat('%', #{workCreateEnterpriseName}, '%')</if>
<if test="workCreateEnterpriseId != null and workCreateEnterpriseId != ''"> and work_create_enterprise_id = #{workCreateEnterpriseId}</if>
<if test="workAssignEnterproseName != null and workAssignEnterproseName != ''"> and work_assign_enterprose_name like concat('%', #{workAssignEnterproseName}, '%')</if>
<if test="workAssignEnterproseId != null "> and work_assign_enterprose_id = #{workAssignEnterproseId}</if>
<if test="workAssignManId != null "> and work_assign_man_id = #{workAssignManId}</if>
<if test="workAssignMan != null and workAssignMan != ''"> and work_assign_man = #{workAssignMan}</if>
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if>
<if test="inspectionDate != null "> and inspection_date = #{inspectionDate}</if>
<if test="inspectionRoute != null and inspectionRoute != ''"> and inspection_route = #{inspectionRoute}</if>
<if test="problemDescription != null and problemDescription != ''"> and problem_description = #{problemDescription}</if>
<if test="iconUrl != null and iconUrl != ''"> and icon_url = #{iconUrl}</if>
<if test="rectificationPlan != null and rectificationPlan != ''"> and rectification_plan = #{rectificationPlan}</if>
<if test="rectificationResult != null and rectificationResult != ''"> and rectification_result = #{rectificationResult}</if>
<if test="responsibleUnit != null and responsibleUnit != ''"> and responsible_unit = #{responsibleUnit}</if>
<if test="responsiblePerson != null and responsiblePerson != ''"> and responsible_person = #{responsiblePerson}</if>
<if test="expiryDate != null "> and expiry_date = #{expiryDate}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTWorkOrderById" parameterType="Long" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/>
where work_id = #{workId}
</select>
<insert id="insertTWorkOrder" parameterType="TWorkOrder" useGeneratedKeys="true" keyProperty="workId">
insert into t_work_order
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workTitle != null">work_title,</if>
<if test="workType != null">work_type,</if>
<if test="workContent != null">work_content,</if>
<if test="workCreateEnterpriseName != null">work_create_enterprise_name,</if>
<if test="workCreateEnterpriseId != null">work_create_enterprise_id,</if>
<if test="workAssignEnterproseName != null">work_assign_enterprose_name,</if>
<if test="workAssignEnterproseId != null">work_assign_enterprose_id,</if>
<if test="workAssignManId != null">work_assign_man_id,</if>
<if test="workAssignMan != null">work_assign_man,</if>
<if test="workStatus != null">work_status,</if>
<if test="inspectionDate != null">inspection_date,</if>
<if test="inspectionRoute != null">inspection_route,</if>
<if test="problemDescription != null">problem_description,</if>
<if test="iconUrl != null">icon_url,</if>
<if test="rectificationPlan != null">rectification_plan,</if>
<if test="rectificationResult != null">rectification_result,</if>
<if test="responsibleUnit != null">responsible_unit,</if>
<if test="responsiblePerson != null">responsible_person,</if>
<if test="expiryDate != null">expiry_date,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workTitle != null">#{workTitle},</if>
<if test="workType != null">#{workType},</if>
<if test="workContent != null">#{workContent},</if>
<if test="workCreateEnterpriseName != null">#{workCreateEnterpriseName},</if>
<if test="workCreateEnterpriseId != null">#{workCreateEnterpriseId},</if>
<if test="workAssignEnterproseName != null">#{workAssignEnterproseName},</if>
<if test="workAssignEnterproseId != null">#{workAssignEnterproseId},</if>
<if test="workAssignManId != null">#{workAssignManId},</if>
<if test="workAssignMan != null">#{workAssignMan},</if>
<if test="workStatus != null">#{workStatus},</if>
<if test="inspectionDate != null">#{inspectionDate},</if>
<if test="inspectionRoute != null">#{inspectionRoute},</if>
<if test="problemDescription != null">#{problemDescription},</if>
<if test="iconUrl != null">#{iconUrl},</if>
<if test="rectificationPlan != null">#{rectificationPlan},</if>
<if test="rectificationResult != null">#{rectificationResult},</if>
<if test="responsibleUnit != null">#{responsibleUnit},</if>
<if test="responsiblePerson != null">#{responsiblePerson},</if>
<if test="expiryDate != null">#{expiryDate},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTWorkOrder" parameterType="TWorkOrder">
update t_work_order
<trim prefix="SET" suffixOverrides=",">
<if test="workTitle != null">work_title = #{workTitle},</if>
<if test="workType != null">work_type = #{workType},</if>
<if test="workContent != null">work_content = #{workContent},</if>
<if test="workCreateEnterpriseName != null">work_create_enterprise_name = #{workCreateEnterpriseName},</if>
<if test="workCreateEnterpriseId != null">work_create_enterprise_id = #{workCreateEnterpriseId},</if>
<if test="workAssignEnterproseName != null">work_assign_enterprose_name = #{workAssignEnterproseName},</if>
<if test="workAssignEnterproseId != null">work_assign_enterprose_id = #{workAssignEnterproseId},</if>
<if test="workAssignManId != null">work_assign_man_id = #{workAssignManId},</if>
<if test="workAssignMan != null">work_assign_man = #{workAssignMan},</if>
<if test="workStatus != null">work_status = #{workStatus},</if>
<if test="inspectionDate != null">inspection_date = #{inspectionDate},</if>
<if test="inspectionRoute != null">inspection_route = #{inspectionRoute},</if>
<if test="problemDescription != null">problem_description = #{problemDescription},</if>
<if test="iconUrl != null">icon_url = #{iconUrl},</if>
<if test="rectificationPlan != null">rectification_plan = #{rectificationPlan},</if>
<if test="rectificationResult != null">rectification_result = #{rectificationResult},</if>
<if test="responsibleUnit != null">responsible_unit = #{responsibleUnit},</if>
<if test="responsiblePerson != null">responsible_person = #{responsiblePerson},</if>
<if test="expiryDate != null">expiry_date = #{expiryDate},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where work_id = #{workId}
</update>
<delete id="deleteTWorkOrderById" parameterType="Long">
delete from t_work_order where work_id = #{workId}
</delete>
<delete id="deleteTWorkOrderByIds" parameterType="String">
delete from t_work_order where work_id in
<foreach item="workId" collection="array" open="(" separator="," close=")">
#{workId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询燃气任务列表
export function listOrder(query) {
return request({
url: '/system/order/list',
method: 'get',
params: query
})
}
// 查询燃气任务详细
export function getOrder(workId) {
return request({
url: '/system/order/' + workId,
method: 'get'
})
}
// 新增燃气任务
export function addOrder(data) {
return request({
url: '/system/order',
method: 'post',
data: data
})
}
// 修改燃气任务
export function updateOrder(data) {
return request({
url: '/system/order',
method: 'put',
data: data
})
}
// 删除燃气任务
export function delOrder(workId) {
return request({
url: '/system/order/' + workId,
method: 'delete'
})
}
// 导出燃气任务
export function exportOrder(query) {
return request({
url: '/system/order/export',
method: 'get',
params: query
})
}
\ No newline at end of file
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="任务标题" prop="workTitle">
<el-input
v-model="queryParams.workTitle"
placeholder="请输入任务标题"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="任务类型" prop="workType">
<el-select v-model="queryParams.workType" placeholder="请选择任务类型" clearable size="small">
<el-option label="入户安检" value="1" />
<el-option label="巡检" value="2" />
<el-option label="报警巡查" value="3" />
<el-option label="其他" value="4" />
</el-select>
</el-form-item>
<el-form-item label="任务状态" prop="workStatus">
<el-select v-model="queryParams.workStatus" placeholder="请选择任务状态" clearable size="small">
<el-option label="派发中" value="1" />
<el-option label="反馈" value="2" />
<el-option label="归档" value="3" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:order:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:order:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:order:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
v-hasPermi="['system:order:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="任务标题" align="center" prop="workTitle" />
<el-table-column label="任务类型" align="center" prop="workType" />
<el-table-column label="任务内容" align="center" prop="workContent" />
<el-table-column label="创建单位" align="center" prop="workCreateEnterpriseName" />
<el-table-column label="指派单位" align="center" prop="workAssignEnterproseName" />
<el-table-column label="指派人" align="center" prop="workAssignManId" />
<el-table-column label="任务状态" align="center" prop="workStatus" />
<el-table-column label="巡检时间" align="center" prop="inspectionDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.inspectionDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="巡检路线" align="center" prop="inspectionRoute" />
<el-table-column label="问题描述" align="center" prop="problemDescription" />
<el-table-column label="问题图片" align="center" prop="pictureUrl" style="text-align:center;">
<template slot-scope="scope">
<img :src="scope.row.iconUrl" style="width: 20%;vertical-align:middle;cursor:pointer;" @click="showPicture(scope.row)"/>
<el-image :ref="'a'+scope.row.workId" :src="scope.row.iconUrl" v-show="false" :preview-src-list="[scope.row.iconUrl]" v-if="scope.row.iconUrl != '' && scope.row.iconUrl != null"></el-image>
</template>
</el-table-column>
<!--<el-table-column label="图片路径" align="center" prop="iconUrl" />-->
<el-table-column label="整改方案" align="center" prop="rectificationPlan" />
<el-table-column label="整改结果" align="center" prop="rectificationResult" />
<el-table-column label="责任单位" align="center" prop="responsibleUnit" />
<el-table-column label="责任人员" align="center" prop="responsiblePerson" />
<el-table-column label="截止日期" align="center" prop="expiryDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.expiryDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button v-if="'admin'==$store.state.user.roles[0] && scope.row.workAssignMan == null && scope.row.workStatus == '1'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:order:edit']"
>任务下发</el-button>
<el-button v-if="'admin'==$store.state.user.roles[0] && scope.row.workStatus == '1'"
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:order:edit']"
>接单</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:order:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:order:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改燃气任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row>
<el-col :span="12">
<el-form-item label="任务标题" prop="workTitle">
<el-input v-model="form.workTitle" placeholder="请输入任务标题" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="任务类型" prop="workType">
<el-select v-model="form.workType" placeholder="请选择任务类型" style="width: 350px">
<el-option label="入户安检" value="1" />
<el-option label="巡检" value="2" />
<el-option label="报警巡查" value="3" />
<el-option label="其他" value="4" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="任务内容">
<editor v-model="form.workContent" :min-height="192"/>
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="指派单位" prop="workAssignEnterproseName">
<el-input v-model="form.workAssignEnterproseName" placeholder="请输入指派单位名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="指派人" prop="workAssignManId">
<el-input v-model="form.workAssignManId" placeholder="请输入指派人" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="巡检时间" prop="inspectionDate">
<el-date-picker clearable size="small"
v-model="form.inspectionDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择巡检时间" style="width: 350px">
</el-date-picker>
</el-form-item>
<el-form-item label="巡检路线" prop="inspectionRoute">
<el-input v-model="form.inspectionRoute" type="textarea" placeholder="请输入巡检路线" />
</el-form-item>
<el-form-item label="问题描述" prop="problemDescription">
<el-input v-model="form.problemDescription" type="textarea" placeholder="请输入问题描述" />
</el-form-item>
<el-form-item label="问题图片" prop="iconUrl">
<MyFileUpload
listType="picture-card"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
</el-form-item>
<el-form-item label="整改方案" prop="rectificationPlan">
<el-input v-model="form.rectificationPlan" type="textarea" placeholder="请输入整改方案" />
</el-form-item>
<el-form-item label="整改结果" prop="rectificationResult">
<el-input v-model="form.rectificationResult" type="textarea" placeholder="请输入整改结果" />
</el-form-item>
<el-row>
<el-col :span="12">
<el-form-item label="责任单位" prop="responsibleUnit">
<el-input v-model="form.responsibleUnit" placeholder="请输入责任单位" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="责任人员" prop="responsiblePerson">
<el-input v-model="form.responsiblePerson" placeholder="请输入责任人员" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="截止日期" prop="expiryDate">
<el-date-picker clearable size="small"
v-model="form.expiryDate"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择截止日期" style="width: 350px">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder } from "@/api/operationMonitor/order";
import Editor from '@/components/Editor';
import MyFileUpload from '@/components/MyFileUpload';
export default {
name: "Order",
components: {
Editor,
MyFileUpload
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 燃气任务表格数据
orderList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 上传文件列表
fileList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
workTitle: null,
workType: null,
workContent: null,
workCreateEnterpriseName: null,
workCreateEnterpriseId: null,
workAssignEnterproseName: null,
workAssignEnterproseId: null,
workAssignManId: null,
workAssignMan: null,
workStatus: null,
inspectionDate: null,
inspectionRoute: null,
problemDescription: null,
iconUrl: null,
rectificationPlan: null,
rectificationResult: null,
responsibleUnit: null,
responsiblePerson: null,
expiryDate: null,
isDel: null,
remarks: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询燃气任务列表 */
getList() {
this.loading = true;
listOrder(this.queryParams).then(response => {
this.orderList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
workId: null,
workTitle: null,
workType: null,
workContent: null,
workCreateEnterpriseName: null,
workCreateEnterpriseId: null,
workAssignEnterproseName: null,
workAssignEnterproseId: null,
workAssignManId: null,
workAssignMan: null,
workStatus: "0",
inspectionDate: null,
inspectionRoute: null,
problemDescription: null,
iconUrl: null,
rectificationPlan: null,
rectificationResult: null,
responsibleUnit: null,
responsiblePerson: null,
expiryDate: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.workId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加燃气任务";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const workId = row.workId || this.ids
getOrder(workId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改燃气任务";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.workId != null) {
updateOrder(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addOrder(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const workIds = row.workId || this.ids;
this.$confirm('是否确认删除燃气任务编号为"' + workIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delOrder(workIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有燃气任务数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportOrder(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
},
getFileInfo(res){
this.form.iconUrl = res.url;
},
listRemove(e) {
this.form.iconUrl = "";
this.fileList = [];
},
showPicture(row){
this.$refs['a'+row.workId].showViewer = true;
}
}
};
</script>
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