增加 轮挡维修
parent
35bd5312ef
commit
82cb1029d0
@ -0,0 +1,127 @@
|
|||||||
|
package com.ruoyi.device.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.device.domain.DeviceBaseFault;
|
||||||
|
import com.ruoyi.device.service.IDeviceBaseFaultService;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障类别维护Controller
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2025-09-24
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/device/device_fault")
|
||||||
|
public class DeviceBaseFaultController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "device/device_fault";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceBaseFaultService deviceBaseFaultService;
|
||||||
|
|
||||||
|
@RequiresPermissions("device:device_fault:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String device_fault()
|
||||||
|
{
|
||||||
|
return prefix + "/device_fault";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障类别维护列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:device_fault:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(DeviceBaseFault deviceBaseFault)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<DeviceBaseFault> list = deviceBaseFaultService.selectDeviceBaseFaultList(deviceBaseFault);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出故障类别维护列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:device_fault:export")
|
||||||
|
@Log(title = "故障类别维护", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(DeviceBaseFault deviceBaseFault)
|
||||||
|
{
|
||||||
|
List<DeviceBaseFault> list = deviceBaseFaultService.selectDeviceBaseFaultList(deviceBaseFault);
|
||||||
|
ExcelUtil<DeviceBaseFault> util = new ExcelUtil<DeviceBaseFault>(DeviceBaseFault.class);
|
||||||
|
return util.exportExcel(list, "故障类别维护数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障类别维护
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存故障类别维护
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:device_fault:add")
|
||||||
|
@Log(title = "故障类别维护", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(DeviceBaseFault deviceBaseFault)
|
||||||
|
{
|
||||||
|
return toAjax(deviceBaseFaultService.insertDeviceBaseFault(deviceBaseFault));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障类别维护
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:device_fault:edit")
|
||||||
|
@GetMapping("/edit/{objid}")
|
||||||
|
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
|
||||||
|
{
|
||||||
|
DeviceBaseFault deviceBaseFault = deviceBaseFaultService.selectDeviceBaseFaultByObjid(objid);
|
||||||
|
mmap.put("deviceBaseFault", deviceBaseFault);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存故障类别维护
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:device_fault:edit")
|
||||||
|
@Log(title = "故障类别维护", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(DeviceBaseFault deviceBaseFault)
|
||||||
|
{
|
||||||
|
return toAjax(deviceBaseFaultService.updateDeviceBaseFault(deviceBaseFault));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障类别维护
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:device_fault:remove")
|
||||||
|
@Log(title = "故障类别维护", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(deviceBaseFaultService.deleteDeviceBaseFaultByObjids(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,145 @@
|
|||||||
|
package com.ruoyi.device.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.common.annotation.Log;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.device.domain.BaseDeviceManufacturer;
|
||||||
|
import com.ruoyi.device.domain.BaseInfo;
|
||||||
|
import com.ruoyi.device.domain.DeviceRepartBills;
|
||||||
|
import com.ruoyi.device.domain.RepairOutsourcing;
|
||||||
|
import com.ruoyi.device.service.*;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.ModelMap;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委外工单Controller
|
||||||
|
*
|
||||||
|
* @author wh
|
||||||
|
* @date 2022-06-08
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/device/repair_outsourcing")
|
||||||
|
public class RepairOutsourcingController extends BaseController {
|
||||||
|
private String prefix = "device/repair_outsourcing";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IRepairOutsourcingService repairOutsourcingService;
|
||||||
|
@Autowired
|
||||||
|
private IBaseInfoService baseScadaDeviceInfoService;
|
||||||
|
private List<BaseInfo> baseScadaDeviceInfos;
|
||||||
|
@Autowired
|
||||||
|
private IBaseManufacturerService baseManufacturerService;
|
||||||
|
private List<BaseDeviceManufacturer> baseManufacturerList;
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresPermissions("device:repair_outsourcing:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String repair_outsourcing() {
|
||||||
|
return prefix + "/repair_outsourcing";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询委外工单列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repair_outsourcing:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(RepairOutsourcing repairOutsourcing) {
|
||||||
|
startPage();
|
||||||
|
List<RepairOutsourcing> list = repairOutsourcingService.selectRepairOutsourcingList(repairOutsourcing);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出委外工单列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repair_outsourcing:export")
|
||||||
|
@Log(title = "委外工单", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(RepairOutsourcing repairOutsourcing) {
|
||||||
|
List<RepairOutsourcing> list = repairOutsourcingService.selectRepairOutsourcingList(repairOutsourcing);
|
||||||
|
ExcelUtil<RepairOutsourcing> util = new ExcelUtil<RepairOutsourcing>(RepairOutsourcing.class);
|
||||||
|
return util.exportExcel(list, "委外工单数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增委外工单
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add(ModelMap mmap) {
|
||||||
|
if (baseScadaDeviceInfos == null || baseScadaDeviceInfos.isEmpty()) {
|
||||||
|
baseScadaDeviceInfos = baseScadaDeviceInfoService.selectBaseInfoList(null);
|
||||||
|
}
|
||||||
|
mmap.put("baseScadaDeviceInfos", baseScadaDeviceInfos);
|
||||||
|
if (baseManufacturerList == null || baseManufacturerList.isEmpty()) {
|
||||||
|
baseManufacturerList = baseManufacturerService.selectBaseManufacturerList(null);
|
||||||
|
}
|
||||||
|
mmap.put("baseManufacturerList", baseManufacturerList);
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
IDeviceRepartBillsService deviceRepartBillsService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存委外工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repair_outsourcing:add")
|
||||||
|
@Log(title = "委外工单", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(RepairOutsourcing repairOutsourcing) {
|
||||||
|
repairOutsourcing.setBillsCode("WW" + DateUtils.dateTimeNow());
|
||||||
|
int i = repairOutsourcingService.insertRepairOutsourcing(repairOutsourcing);
|
||||||
|
if (i > 0 && repairOutsourcing.getRepairBillsCode() != null) {
|
||||||
|
DeviceRepartBills deviceRepartBills = new DeviceRepartBills();
|
||||||
|
deviceRepartBills.setObjid(repairOutsourcing.getRepairBillsCode());
|
||||||
|
deviceRepartBills.setOrderState(3L);
|
||||||
|
deviceRepartBillsService.updateDeviceRepartBills(deviceRepartBills);
|
||||||
|
}
|
||||||
|
return toAjax(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改委外工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repair_outsourcing:edit")
|
||||||
|
@GetMapping("/edit/{objid}")
|
||||||
|
public String edit(@PathVariable("objid") Long objid, ModelMap mmap) {
|
||||||
|
RepairOutsourcing repairOutsourcing = repairOutsourcingService.selectRepairOutsourcingByObjid(objid);
|
||||||
|
mmap.put("repairOutsourcing", repairOutsourcing);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存委外工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repair_outsourcing:edit")
|
||||||
|
@Log(title = "委外工单", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(RepairOutsourcing repairOutsourcing) {
|
||||||
|
return toAjax(repairOutsourcingService.updateRepairOutsourcing(repairOutsourcing));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除委外工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repair_outsourcing:remove")
|
||||||
|
@Log(title = "委外工单", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
|
return toAjax(repairOutsourcingService.deleteRepairOutsourcingByObjids(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
package com.ruoyi.device.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障类别维护对象 device_base_fault
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2025-09-24
|
||||||
|
*/
|
||||||
|
public class DeviceBaseFault extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** */
|
||||||
|
private Long objid;
|
||||||
|
|
||||||
|
/** 故障代码 */
|
||||||
|
@Excel(name = "故障代码")
|
||||||
|
private String faultCode;
|
||||||
|
|
||||||
|
/** 故障名称 */
|
||||||
|
@Excel(name = "故障名称")
|
||||||
|
private String faultName;
|
||||||
|
|
||||||
|
/** 故障说明 */
|
||||||
|
@Excel(name = "故障说明")
|
||||||
|
private String faultInfo;
|
||||||
|
|
||||||
|
/** 应急措施 */
|
||||||
|
@Excel(name = "应急措施")
|
||||||
|
private String emergencyMeasures;
|
||||||
|
|
||||||
|
public void setObjid(Long objid)
|
||||||
|
{
|
||||||
|
this.objid = objid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getObjid()
|
||||||
|
{
|
||||||
|
return objid;
|
||||||
|
}
|
||||||
|
public void setFaultCode(String faultCode)
|
||||||
|
{
|
||||||
|
this.faultCode = faultCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFaultCode()
|
||||||
|
{
|
||||||
|
return faultCode;
|
||||||
|
}
|
||||||
|
public void setFaultName(String faultName)
|
||||||
|
{
|
||||||
|
this.faultName = faultName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFaultName()
|
||||||
|
{
|
||||||
|
return faultName;
|
||||||
|
}
|
||||||
|
public void setFaultInfo(String faultInfo)
|
||||||
|
{
|
||||||
|
this.faultInfo = faultInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFaultInfo()
|
||||||
|
{
|
||||||
|
return faultInfo;
|
||||||
|
}
|
||||||
|
public void setEmergencyMeasures(String emergencyMeasures)
|
||||||
|
{
|
||||||
|
this.emergencyMeasures = emergencyMeasures;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmergencyMeasures()
|
||||||
|
{
|
||||||
|
return emergencyMeasures;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("objid", getObjid())
|
||||||
|
.append("faultcode", getFaultCode())
|
||||||
|
.append("faultName", getFaultName())
|
||||||
|
.append("faultInfo", getFaultInfo())
|
||||||
|
.append("emergencyMeasures", getEmergencyMeasures())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,154 @@
|
|||||||
|
package com.ruoyi.device.domain;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.ruoyi.common.annotation.Excel;
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委外工单对象 device_repair_outsourcing
|
||||||
|
*
|
||||||
|
* @author wh
|
||||||
|
* @date 2022-06-08
|
||||||
|
*/
|
||||||
|
public class RepairOutsourcing extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long objid;
|
||||||
|
|
||||||
|
/** 单号 */
|
||||||
|
@Excel(name = "单号")
|
||||||
|
private String billsCode;
|
||||||
|
|
||||||
|
/** 设备ID */
|
||||||
|
@Excel(name = "设备ID")
|
||||||
|
private Long deviceId;
|
||||||
|
|
||||||
|
/** 委外单位 */
|
||||||
|
@Excel(name = "委外单位")
|
||||||
|
private String manufacturerName;
|
||||||
|
|
||||||
|
/** 联系人 */
|
||||||
|
@Excel(name = "联系人")
|
||||||
|
private String contacts;
|
||||||
|
|
||||||
|
/** 联系方式 */
|
||||||
|
@Excel(name = "联系方式")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/** 申请原因 */
|
||||||
|
@Excel(name = "申请原因")
|
||||||
|
private String reason;
|
||||||
|
/** 结束时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date endDay;
|
||||||
|
private BaseInfo deviceInfo;
|
||||||
|
private Long repairBillsCode;
|
||||||
|
public BaseInfo getDeviceInfo() {
|
||||||
|
return deviceInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getRepairBillsCode() {
|
||||||
|
return repairBillsCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRepairBillsCode(Long repairBillsCode) {
|
||||||
|
this.repairBillsCode = repairBillsCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDeviceInfo(BaseInfo deviceInfo) {
|
||||||
|
this.deviceInfo = deviceInfo;
|
||||||
|
}
|
||||||
|
public void setObjid(Long objid)
|
||||||
|
{
|
||||||
|
this.objid = objid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getObjid()
|
||||||
|
{
|
||||||
|
return objid;
|
||||||
|
}
|
||||||
|
public void setBillsCode(String billsCode)
|
||||||
|
{
|
||||||
|
this.billsCode = billsCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBillsCode()
|
||||||
|
{
|
||||||
|
return billsCode;
|
||||||
|
}
|
||||||
|
public void setDeviceId(Long deviceId)
|
||||||
|
{
|
||||||
|
this.deviceId = deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getDeviceId()
|
||||||
|
{
|
||||||
|
return deviceId;
|
||||||
|
}
|
||||||
|
public void setManufacturerName(String manufacturerName)
|
||||||
|
{
|
||||||
|
this.manufacturerName = manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManufacturerName()
|
||||||
|
{
|
||||||
|
return manufacturerName;
|
||||||
|
}
|
||||||
|
public void setContacts(String contacts)
|
||||||
|
{
|
||||||
|
this.contacts = contacts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContacts()
|
||||||
|
{
|
||||||
|
return contacts;
|
||||||
|
}
|
||||||
|
public void setPhone(String phone)
|
||||||
|
{
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone()
|
||||||
|
{
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
public void setReason(String reason)
|
||||||
|
{
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReason()
|
||||||
|
{
|
||||||
|
return reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getEndDay() {
|
||||||
|
return endDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEndDay(Date endDay) {
|
||||||
|
this.endDay = endDay;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("objid", getObjid())
|
||||||
|
.append("billsCode", getBillsCode())
|
||||||
|
.append("deviceId", getDeviceId())
|
||||||
|
.append("manufacturerName", getManufacturerName())
|
||||||
|
.append("contacts", getContacts())
|
||||||
|
.append("phone", getPhone())
|
||||||
|
.append("reason", getReason())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.device.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.device.domain.DeviceBaseFault;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
/**
|
||||||
|
* 故障类别维护Mapper接口
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2025-09-24
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface DeviceBaseFaultMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询故障类别维护
|
||||||
|
*
|
||||||
|
* @param objid 故障类别维护主键
|
||||||
|
* @return 故障类别维护
|
||||||
|
*/
|
||||||
|
public DeviceBaseFault selectDeviceBaseFaultByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障类别维护列表
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 故障类别维护集合
|
||||||
|
*/
|
||||||
|
public List<DeviceBaseFault> selectDeviceBaseFaultList(DeviceBaseFault deviceBaseFault);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障类别维护
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceBaseFault(DeviceBaseFault deviceBaseFault);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障类别维护
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceBaseFault(DeviceBaseFault deviceBaseFault);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障类别维护
|
||||||
|
*
|
||||||
|
* @param objid 故障类别维护主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceBaseFaultByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除故障类别维护
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceBaseFaultByObjids(String[] objids);
|
||||||
|
|
||||||
|
List<DeviceBaseFault> selectFaultList();
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.device.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.RepairOutsourcing;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委外工单Mapper接口
|
||||||
|
*
|
||||||
|
* @author wh
|
||||||
|
* @date 2022-06-08
|
||||||
|
*/
|
||||||
|
public interface RepairOutsourcingMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询委外工单
|
||||||
|
*
|
||||||
|
* @param objid 委外工单主键
|
||||||
|
* @return 委外工单
|
||||||
|
*/
|
||||||
|
public RepairOutsourcing selectRepairOutsourcingByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询委外工单列表
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 委外工单集合
|
||||||
|
*/
|
||||||
|
public List<RepairOutsourcing> selectRepairOutsourcingList(RepairOutsourcing repairOutsourcing);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增委外工单
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertRepairOutsourcing(RepairOutsourcing repairOutsourcing);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改委外工单
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateRepairOutsourcing(RepairOutsourcing repairOutsourcing);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除委外工单
|
||||||
|
*
|
||||||
|
* @param objid 委外工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRepairOutsourcingByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除委外工单
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRepairOutsourcingByObjids(String[] objids);
|
||||||
|
}
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
package com.ruoyi.device.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.device.domain.DeviceBaseFault;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障类别维护Service接口
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2025-09-24
|
||||||
|
*/
|
||||||
|
public interface IDeviceBaseFaultService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询故障类别维护
|
||||||
|
*
|
||||||
|
* @param objid 故障类别维护主键
|
||||||
|
* @return 故障类别维护
|
||||||
|
*/
|
||||||
|
public DeviceBaseFault selectDeviceBaseFaultByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障类别维护列表
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 故障类别维护集合
|
||||||
|
*/
|
||||||
|
public List<DeviceBaseFault> selectDeviceBaseFaultList(DeviceBaseFault deviceBaseFault);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障类别维护
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceBaseFault(DeviceBaseFault deviceBaseFault);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障类别维护
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceBaseFault(DeviceBaseFault deviceBaseFault);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除故障类别维护
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的故障类别维护主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceBaseFaultByObjids(String objids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障类别维护信息
|
||||||
|
*
|
||||||
|
* @param objid 故障类别维护主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceBaseFaultByObjid(Long objid);
|
||||||
|
|
||||||
|
List<DeviceBaseFault> selectFaultList();
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.ruoyi.device.service;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.RepairOutsourcing;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委外工单Service接口
|
||||||
|
*
|
||||||
|
* @author wh
|
||||||
|
* @date 2022-06-08
|
||||||
|
*/
|
||||||
|
public interface IRepairOutsourcingService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询委外工单
|
||||||
|
*
|
||||||
|
* @param objid 委外工单主键
|
||||||
|
* @return 委外工单
|
||||||
|
*/
|
||||||
|
public RepairOutsourcing selectRepairOutsourcingByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询委外工单列表
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 委外工单集合
|
||||||
|
*/
|
||||||
|
public List<RepairOutsourcing> selectRepairOutsourcingList(RepairOutsourcing repairOutsourcing);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增委外工单
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertRepairOutsourcing(RepairOutsourcing repairOutsourcing);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改委外工单
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateRepairOutsourcing(RepairOutsourcing repairOutsourcing);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除委外工单
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的委外工单主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRepairOutsourcingByObjids(String objids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除委外工单信息
|
||||||
|
*
|
||||||
|
* @param objid 委外工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRepairOutsourcingByObjid(Long objid);
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
package com.ruoyi.device.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
|
import com.ruoyi.device.domain.DeviceBaseFault;
|
||||||
|
import com.ruoyi.device.mapper.DeviceBaseFaultMapper;
|
||||||
|
import com.ruoyi.device.service.IDeviceBaseFaultService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 故障类别维护Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2025-09-24
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeviceBaseFaultServiceImpl implements IDeviceBaseFaultService {
|
||||||
|
@Autowired
|
||||||
|
private DeviceBaseFaultMapper deviceBaseFaultMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障类别维护
|
||||||
|
*
|
||||||
|
* @param objid 故障类别维护主键
|
||||||
|
* @return 故障类别维护
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DeviceBaseFault selectDeviceBaseFaultByObjid(Long objid) {
|
||||||
|
return deviceBaseFaultMapper.selectDeviceBaseFaultByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询故障类别维护列表
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 故障类别维护
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<DeviceBaseFault> selectDeviceBaseFaultList(DeviceBaseFault deviceBaseFault) {
|
||||||
|
return deviceBaseFaultMapper.selectDeviceBaseFaultList(deviceBaseFault);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增故障类别维护
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertDeviceBaseFault(DeviceBaseFault deviceBaseFault) {
|
||||||
|
deviceBaseFault.setCreateBy(ShiroUtils.getLoginName());
|
||||||
|
deviceBaseFault.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return deviceBaseFaultMapper.insertDeviceBaseFault(deviceBaseFault);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改故障类别维护
|
||||||
|
*
|
||||||
|
* @param deviceBaseFault 故障类别维护
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateDeviceBaseFault(DeviceBaseFault deviceBaseFault) {
|
||||||
|
deviceBaseFault.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
|
deviceBaseFault.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return deviceBaseFaultMapper.updateDeviceBaseFault(deviceBaseFault);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除故障类别维护
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的故障类别维护主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceBaseFaultByObjids(String objids) {
|
||||||
|
return deviceBaseFaultMapper.deleteDeviceBaseFaultByObjids(Convert.toStrArray(objids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除故障类别维护信息
|
||||||
|
*
|
||||||
|
* @param objid 故障类别维护主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceBaseFaultByObjid(Long objid) {
|
||||||
|
return deviceBaseFaultMapper.deleteDeviceBaseFaultByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DeviceBaseFault> selectFaultList() {
|
||||||
|
return deviceBaseFaultMapper.selectFaultList();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
package com.ruoyi.device.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.utils.DateUtils;
|
||||||
|
import com.ruoyi.common.utils.ShiroUtils;
|
||||||
|
import com.ruoyi.device.domain.RepairOutsourcing;
|
||||||
|
import com.ruoyi.device.mapper.RepairOutsourcingMapper;
|
||||||
|
import com.ruoyi.device.service.IRepairOutsourcingService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委外工单Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wh
|
||||||
|
* @date 2022-06-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RepairOutsourcingServiceImpl implements IRepairOutsourcingService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private RepairOutsourcingMapper repairOutsourcingMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询委外工单
|
||||||
|
*
|
||||||
|
* @param objid 委外工单主键
|
||||||
|
* @return 委外工单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RepairOutsourcing selectRepairOutsourcingByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return repairOutsourcingMapper.selectRepairOutsourcingByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询委外工单列表
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 委外工单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RepairOutsourcing> selectRepairOutsourcingList(RepairOutsourcing repairOutsourcing)
|
||||||
|
{
|
||||||
|
return repairOutsourcingMapper.selectRepairOutsourcingList(repairOutsourcing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增委外工单
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertRepairOutsourcing(RepairOutsourcing repairOutsourcing)
|
||||||
|
{
|
||||||
|
repairOutsourcing.setCreateBy(ShiroUtils.getLoginName());
|
||||||
|
repairOutsourcing.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return repairOutsourcingMapper.insertRepairOutsourcing(repairOutsourcing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改委外工单
|
||||||
|
*
|
||||||
|
* @param repairOutsourcing 委外工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateRepairOutsourcing(RepairOutsourcing repairOutsourcing)
|
||||||
|
{
|
||||||
|
return repairOutsourcingMapper.updateRepairOutsourcing(repairOutsourcing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除委外工单
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的委外工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRepairOutsourcingByObjids(String objids)
|
||||||
|
{
|
||||||
|
return repairOutsourcingMapper.deleteRepairOutsourcingByObjids(Convert.toStrArray(objids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除委外工单信息
|
||||||
|
*
|
||||||
|
* @param objid 委外工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRepairOutsourcingByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return repairOutsourcingMapper.deleteRepairOutsourcingByObjid(objid);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,90 @@
|
|||||||
|
<?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.ruoyi.device.mapper.DeviceBaseFaultMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.device.domain.DeviceBaseFault" id="DeviceBaseFaultResult">
|
||||||
|
<result property="objid" column="objid" />
|
||||||
|
<result property="faultCode" column="fault_code" />
|
||||||
|
<result property="faultName" column="fault_name" />
|
||||||
|
<result property="faultInfo" column="fault_info" />
|
||||||
|
<result property="emergencyMeasures" column="emergency_measures" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDeviceBaseFaultVo">
|
||||||
|
select objid, fault_code, fault_name, fault_info, emergency_measures, create_by, create_time, update_by, update_time from device_base_fault
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectFaultList" resultMap="DeviceBaseFaultResult">
|
||||||
|
<include refid="selectDeviceBaseFaultVo"/>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
<select id="selectDeviceBaseFaultList" parameterType="DeviceBaseFault" resultMap="DeviceBaseFaultResult">
|
||||||
|
<include refid="selectDeviceBaseFaultVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="faultCode != null and faultCode != ''"> and fault_code = #{faultCode}</if>
|
||||||
|
<if test="faultName != null and faultName != ''"> and fault_name like concat('%', #{faultName}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDeviceBaseFaultByObjid" parameterType="Long" resultMap="DeviceBaseFaultResult">
|
||||||
|
<include refid="selectDeviceBaseFaultVo"/>
|
||||||
|
where objid = #{objid}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDeviceBaseFault" parameterType="DeviceBaseFault" useGeneratedKeys="true" keyProperty="objid">
|
||||||
|
insert into device_base_fault
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="faultCode != null">fault_code,</if>
|
||||||
|
<if test="faultName != null">fault_name,</if>
|
||||||
|
<if test="faultInfo != null">fault_info,</if>
|
||||||
|
<if test="emergencyMeasures != null">emergency_measures,</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>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="faultCode != null">#{faultCode},</if>
|
||||||
|
<if test="faultName != null">#{faultName},</if>
|
||||||
|
<if test="faultInfo != null">#{faultInfo},</if>
|
||||||
|
<if test="emergencyMeasures != null">#{emergencyMeasures},</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>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDeviceBaseFault" parameterType="DeviceBaseFault">
|
||||||
|
update device_base_fault
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="faultCode != null">fault_code = #{faultCode},</if>
|
||||||
|
<if test="faultName != null">fault_name = #{faultName},</if>
|
||||||
|
<if test="faultInfo != null">fault_info = #{faultInfo},</if>
|
||||||
|
<if test="emergencyMeasures != null">emergency_measures = #{emergencyMeasures},</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>
|
||||||
|
</trim>
|
||||||
|
where objid = #{objid}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceBaseFaultByObjid" parameterType="Long">
|
||||||
|
delete from device_base_fault where objid = #{objid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceBaseFaultByObjids" parameterType="String">
|
||||||
|
delete from device_base_fault where objid in
|
||||||
|
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,105 @@
|
|||||||
|
<?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.ruoyi.device.mapper.RepairOutsourcingMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.device.domain.RepairOutsourcing" id="RepairOutsourcingResult">
|
||||||
|
<result property="objid" column="objid" />
|
||||||
|
<result property="billsCode" column="bills_code" />
|
||||||
|
<result property="deviceId" column="device_id" />
|
||||||
|
<result property="manufacturerName" column="manufacturer_name" />
|
||||||
|
<result property="contacts" column="contacts" />
|
||||||
|
<result property="phone" column="phone" />
|
||||||
|
<result property="reason" column="reason" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="endDay" column="end_day" />
|
||||||
|
<association property="deviceInfo" resultMap="com.ruoyi.device.mapper.BaseInfoMapper.BaseInfoResult"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectRepairOutsourcingVo">
|
||||||
|
select dro.objid,
|
||||||
|
bills_code,
|
||||||
|
dro.device_id,
|
||||||
|
manufacturer_name,
|
||||||
|
contacts,
|
||||||
|
phone,
|
||||||
|
reason,
|
||||||
|
dro.create_by,
|
||||||
|
dro.create_time,
|
||||||
|
bsd.obj_id,
|
||||||
|
device_name,
|
||||||
|
end_day
|
||||||
|
from device_repair_outsourcing dro
|
||||||
|
left join device_base_info bsd on dro.device_id = bsd.obj_id
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectRepairOutsourcingList" parameterType="RepairOutsourcing" resultMap="RepairOutsourcingResult">
|
||||||
|
<include refid="selectRepairOutsourcingVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="billsCode != null and billsCode != ''"> and dro.bills_code = #{billsCode}</if>
|
||||||
|
<if test="deviceId != null "> and dro.device_id = #{deviceId}</if>
|
||||||
|
<if test="manufacturerName != null and manufacturerName != ''"> and manufacturer_name like concat('%', #{manufacturerName}, '%')</if>
|
||||||
|
<if test="createBy != null and createBy != ''"> and dro.create_by = #{createBy}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRepairOutsourcingByObjid" parameterType="Long" resultMap="RepairOutsourcingResult">
|
||||||
|
<include refid="selectRepairOutsourcingVo"/>
|
||||||
|
where dro.objid = #{objid}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertRepairOutsourcing" parameterType="RepairOutsourcing" useGeneratedKeys="true" keyProperty="objid">
|
||||||
|
insert into device_repair_outsourcing
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="billsCode != null">bills_code,</if>
|
||||||
|
<if test="deviceId != null">device_id,</if>
|
||||||
|
<if test="manufacturerName != null">manufacturer_name,</if>
|
||||||
|
<if test="contacts != null">contacts,</if>
|
||||||
|
<if test="phone != null">phone,</if>
|
||||||
|
<if test="reason != null">reason,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="endDay != null">end_day,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="billsCode != null">#{billsCode},</if>
|
||||||
|
<if test="deviceId != null">#{deviceId},</if>
|
||||||
|
<if test="manufacturerName != null">#{manufacturerName},</if>
|
||||||
|
<if test="contacts != null">#{contacts},</if>
|
||||||
|
<if test="phone != null">#{phone},</if>
|
||||||
|
<if test="reason != null">#{reason},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="endDay != null">#{endDay},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateRepairOutsourcing" parameterType="RepairOutsourcing">
|
||||||
|
update device_repair_outsourcing
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="billsCode != null">bills_code = #{billsCode},</if>
|
||||||
|
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||||
|
<if test="manufacturerName != null">manufacturer_name = #{manufacturerName},</if>
|
||||||
|
<if test="contacts != null">contacts = #{contacts},</if>
|
||||||
|
<if test="phone != null">phone = #{phone},</if>
|
||||||
|
<if test="reason != null">reason = #{reason},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
where objid = #{objid}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteRepairOutsourcingByObjid" parameterType="Long">
|
||||||
|
delete from device_repair_outsourcing where objid = #{objid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteRepairOutsourcingByObjids" parameterType="String">
|
||||||
|
delete from device_repair_outsourcing where objid in
|
||||||
|
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增故障类别维护')" />
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-device_fault-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">故障代码:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="faultCode" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">故障名称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="faultName" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">故障说明:</label>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="faultInfo" class="form-control" rows="3"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">应急措施:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="emergencyMeasures" class="form-control" rows="3"></textarea>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "device/device_fault"
|
||||||
|
$("#form-device_fault-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-device_fault-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,118 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('故障类别维护列表')" />
|
||||||
|
</head>
|
||||||
|
<body class="gray-bg">
|
||||||
|
<div class="container-div">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-12 search-collapse">
|
||||||
|
<form id="formId">
|
||||||
|
<div class="select-list">
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<label>故障代码:</label>
|
||||||
|
<input type="text" name="faultCode"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>故障名称:</label>
|
||||||
|
<input type="text" name="faultName"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||||
|
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="btn-group-sm" id="toolbar" role="group">
|
||||||
|
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="device:device_fault:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="device:device_fault:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="device:device_fault:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="device:device_fault:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm-12 select-table table-striped">
|
||||||
|
<table id="bootstrap-table"></table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('device:device_fault:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('device:device_fault:remove')}]];
|
||||||
|
var prefix = ctx + "device/device_fault";
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
modalName: "故障类别维护",
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'objid',
|
||||||
|
title: '',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'faultCode',
|
||||||
|
title: '故障代码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'faultName',
|
||||||
|
title: '故障名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'faultInfo',
|
||||||
|
title: '故障说明'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'emergencyMeasures',
|
||||||
|
title: '应急措施'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createBy',
|
||||||
|
title: '创建人'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '创建时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updateBy',
|
||||||
|
title: '修改人'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'updateTime',
|
||||||
|
title: '修改时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '操作',
|
||||||
|
align: 'center',
|
||||||
|
formatter: function(value, row, index) {
|
||||||
|
var actions = [];
|
||||||
|
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.objid + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||||
|
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.objid + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||||
|
return actions.join('');
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
$.table.init(options);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,94 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('修改故障类别维护')" />
|
||||||
|
<th:block th:include="include :: summernote-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-device_fault-edit" th:object="${deviceBaseFault}">
|
||||||
|
<input name="objid" th:field="*{objid}" type="hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">故障代码:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="faultcode" th:field="*{faultCode}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">故障名称:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="faultName" th:field="*{faultName}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">故障说明:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="faultInfo" th:field="*{faultInfo}" class="form-control" rows="3" type="text"></textarea>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">应急措施:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="emergencyMeasures" th:field="*{emergencyMeasures}" class="form-control" rows="3" type="text"></textarea>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<th:block th:include="include :: summernote-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "device/device_fault";
|
||||||
|
$("#form-device_fault-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-device_fault-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$('.summernote').each(function(i) {
|
||||||
|
$('#' + this.id).summernote({
|
||||||
|
lang: 'zh-CN',
|
||||||
|
dialogsInBody: true,
|
||||||
|
callbacks: {
|
||||||
|
onChange: function(contents, $edittable) {
|
||||||
|
$("input[name='" + this.id + "']").val(contents);
|
||||||
|
},
|
||||||
|
onImageUpload: function(files) {
|
||||||
|
var obj = this;
|
||||||
|
var data = new FormData();
|
||||||
|
data.append("file", files[0]);
|
||||||
|
$.ajax({
|
||||||
|
type: "post",
|
||||||
|
url: ctx + "common/upload",
|
||||||
|
data: data,
|
||||||
|
cache: false,
|
||||||
|
contentType: false,
|
||||||
|
processData: false,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(result) {
|
||||||
|
if (result.code == web_status.SUCCESS) {
|
||||||
|
$('#' + obj.id).summernote('insertImage', result.url);
|
||||||
|
} else {
|
||||||
|
$.modal.alertError(result.msg);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(error) {
|
||||||
|
$.modal.alertWarning("图片上传失败。");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var content = $("input[name='" + this.id + "']").val();
|
||||||
|
$('#' + this.id).summernote('code', content);
|
||||||
|
})
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,115 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
||||||
|
<head>
|
||||||
|
<th:block th:include="include :: header('新增委外工单')"/>
|
||||||
|
<th:block th:include="include :: select2-css"/>
|
||||||
|
<th:block th:include="include :: datetimepicker-css" />
|
||||||
|
</head>
|
||||||
|
<body class="white-bg">
|
||||||
|
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||||
|
<form class="form-horizontal m" id="form-repair_outsourcing-add">
|
||||||
|
<div class=" form-group">
|
||||||
|
<label class="col-sm-3 control-label">设备编码:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<!-- <input name="deviceId" class="form-control" type="text">-->
|
||||||
|
<select id="deviceId" name="deviceId" class="form-control select2-multiple">
|
||||||
|
<option th:each="baseScadaDeviceInfo:${baseScadaDeviceInfos}"
|
||||||
|
th:value="${baseScadaDeviceInfo.uuid}"
|
||||||
|
th:text="${baseScadaDeviceInfo.deviceName}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">委外单位:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<!-- <input name="manufacturerName" class="form-control" type="text">-->
|
||||||
|
<select id="manufacturerName" name="manufacturerName" class="form-control select2-multiple">
|
||||||
|
<option value=""/>
|
||||||
|
<option th:each="base:${baseManufacturerList}"
|
||||||
|
th:value="${base.manufacturerName}"
|
||||||
|
th:text="${base.manufacturerName}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系人:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="contacts" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">联系方式:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="phone" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">申请原因:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<textarea name="reason" class="form-control" type="text"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">结束时间:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<div class="input-group date">
|
||||||
|
<input name="endDay" class="form-control" placeholder="yyyy-MM-dd" type="text">
|
||||||
|
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer"/>
|
||||||
|
<th:block th:include="include :: select2-js"/>
|
||||||
|
<th:block th:include="include :: datetimepicker-js" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "device/repair_outsourcing"
|
||||||
|
var datas = [[${baseManufacturerList}]]
|
||||||
|
$("#form-repair_outsourcing-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
$(function () {
|
||||||
|
$('#manufacturerName').select2({
|
||||||
|
placeholder: "请选择设备厂家",
|
||||||
|
allowClear: false
|
||||||
|
});
|
||||||
|
// $('#deviceId').select2({
|
||||||
|
// placeholder: "请选择设备",
|
||||||
|
// allowClear: true
|
||||||
|
// });
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$('#manufacturerName').on('select2:select', function (e) {
|
||||||
|
var name = $('#manufacturerName').select2('val');
|
||||||
|
datas.forEach(function (value, i) {
|
||||||
|
console.log('forEach遍历: 第【' + i + '】项的值为:' + value.manufacturerName);
|
||||||
|
if (value.manufacturerName == name) {
|
||||||
|
|
||||||
|
$("input[name=contacts]").val(value.contacts);
|
||||||
|
$("input[name=phone]").val(value.phone);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
});
|
||||||
|
$("input[name='endDay']").datetimepicker({
|
||||||
|
format: "yyyy-mm-dd",
|
||||||
|
minView: "month",
|
||||||
|
autoclose: true
|
||||||
|
});
|
||||||
|
function submitHandler() {
|
||||||
|
var name = $('#manufacturerName').select2('val');
|
||||||
|
if (name == null) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-repair_outsourcing-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue