增加 轮挡维修

master
wanghao 5 months ago
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));
}
}

@ -1,26 +1,27 @@
package com.ruoyi.device.controller;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.device.domain.BaseInfo;
import com.ruoyi.device.domain.RecordUse;
import com.ruoyi.device.service.IBaseInfoService;
import com.ruoyi.device.service.IRecordUseService;
import com.ruoyi.device.domain.MyResult;
import com.ruoyi.device.service.IPdaApiService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.device.domain.*;
import com.ruoyi.device.service.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.time.LocalDate;
import java.time.YearMonth;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import static com.ruoyi.common.core.domain.AjaxResult.error;
import static com.ruoyi.common.core.domain.AjaxResult.success;
@ -56,8 +57,10 @@ public class PdaApiController {
ResponseEntity<String> response = null;
try {
RestTemplate restTemplate = new RestTemplate();
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setConnectTimeout(3000); // 连接超时3秒
requestFactory.setReadTimeout(3000); // 读取超时3秒
RestTemplate restTemplate = new RestTemplate(requestFactory);
String url = "http://119.45.202.115:7789/devcontrolbusiness/unlock?idStr=" + baseInfo.getOpenCode() + "&password=" + baseInfo.getOpenPassword();
// 根据实际情况调整参数值
response = restTemplate.getForEntity(url, String.class);
@ -93,7 +96,10 @@ public class PdaApiController {
System.out.println("开锁:"+openCode+",密码:"+openPassword);
ResponseEntity<String> response = null;
try {
RestTemplate restTemplate = new RestTemplate();
SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory();
requestFactory.setConnectTimeout(3000); // 连接超时3秒
requestFactory.setReadTimeout(3000); // 读取超时3秒
RestTemplate restTemplate = new RestTemplate(requestFactory);
String url = "http://119.45.202.115:7789/devcontrolbusiness/unlock?idStr=" + openCode + "&password=" + openPassword;
// 根据实际情况调整参数值
response = restTemplate.getForEntity(url, String.class);
@ -152,8 +158,53 @@ public class PdaApiController {
@PostMapping("/record/selectUseList")
public AjaxResult selectUseList() {
List<RecordUse> list=service.selectUseList();
return success(list);
}
@Autowired
private IDeviceBaseFaultService faultInfoService;
@PostMapping("/fault/selectFaultList")
public AjaxResult selectFaultList() {
List<DeviceBaseFault> list=faultInfoService.selectFaultList();
return success(list);
}
/**
*
*
* @param json
* @param file
* @return
*/
@PostMapping("/bx/subment")
private AjaxResult bx_subment(@RequestParam("json") String json, @RequestParam("file") List<MultipartFile> file) {
System.out.println("报修-生成记录");
String pictruePath = "";
try {
if (file != null && !file.isEmpty()) {
List<String> pictruePaths = new ArrayList<>(file.size());
String filePath = RuoYiConfig.getUploadPath() + "/fault";
for (MultipartFile multipartFile : file) {
System.out.println("上传图片路径:" + multipartFile.getOriginalFilename());
String pathName = FileUploadUtils.upload(filePath, multipartFile);
System.out.println("上传图片路径:" + pathName);
pictruePaths.add(pathName);
}
pictruePath = String.join(",", pictruePaths);
}
} catch (IOException e) {
e.printStackTrace();
}
String bills_code = "WX" + DateUtils.dateTimeNow();
DeviceRepartBills been = JSONObject.parseObject(json, DeviceRepartBills.class);
been.setWorkOrder(bills_code);
been.setPictures(pictruePath);
boolean b = deviceRepartBillsService.insertDeviceRepartBills(been) > 0;
return b ?success():error();
}
@Autowired
private IDeviceRepartBillsService deviceRepartBillsService;
}

@ -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();
}
}

@ -7,45 +7,70 @@ import org.apache.commons.lang3.builder.ToStringStyle;
/**
* device_repart_bills
*
*
* @author ruoyi
* @date 2022-05-26
*/
public class DeviceRepartBills extends BaseEntity
{
public class DeviceRepartBills extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 主键 */
/**
*
*/
private Long objid;
/** 维修单号 */
/**
*
*/
@Excel(name = "维修单号")
private String workOrder;
/** 设备编号 */
/**
*
*/
@Excel(name = "设备编号")
private String deviceID;
/** 故障类别 */
/**
*
*/
@Excel(name = "故障类别")
private Long faultType;
/** 涉及操作 */
/**
*
*/
@Excel(name = "涉及操作")
private String operation;
/** 照片路径 */
/**
*
*/
@Excel(name = "照片路径")
private String pictures;
/** 工单状态 0-待维修1-维修中,2-完成,3-转为外协 */
/**
* 0-1-,2-,3-
*/
@Excel(name = "工单状态 0-待维修1-维修中,2-完成,3-转为外协")
private Long orderState;
/** 工单来源 */
/**
*
*/
@Excel(name = "工单来源")
private Long billsType;
private BaseInfo deviceInfo;
private DeviceBaseFault deviceBaseFault;
public DeviceBaseFault getDeviceBaseFault() {
return deviceBaseFault;
}
public void setDeviceBaseFault(DeviceBaseFault deviceBaseFault) {
this.deviceBaseFault = deviceBaseFault;
}
public BaseInfo getDeviceInfo() {
return deviceInfo;
@ -55,93 +80,77 @@ public class DeviceRepartBills extends BaseEntity
this.deviceInfo = deviceInfo;
}
public void setObjid(Long objid)
{
public Long getObjid() {
return objid;
}
public void setObjid(Long objid) {
this.objid = objid;
}
public Long getObjid()
{
return objid;
public String getWorkOrder() {
return workOrder;
}
public void setWorkOrder(String workOrder)
{
public void setWorkOrder(String workOrder) {
this.workOrder = workOrder;
}
public String getWorkOrder()
{
return workOrder;
public String getDeviceID() {
return deviceID;
}
public void setDeviceID(String deviceID)
{
public void setDeviceID(String deviceID) {
this.deviceID = deviceID;
}
public String getDeviceID()
{
return deviceID;
public Long getFaultType() {
return faultType;
}
public void setFaultType(Long faultType)
{
public void setFaultType(Long faultType) {
this.faultType = faultType;
}
public Long getFaultType()
{
return faultType;
public String getOperation() {
return operation;
}
public void setOperation(String operation)
{
/**
*
*
* @param operation
*/
public void setOperation(String operation) {
this.operation = operation;
}
public String getOperation()
{
return operation;
public String getPictures() {
return pictures;
}
public void setPictures(String pictures)
{
public void setPictures(String pictures) {
this.pictures = pictures;
}
public String getPictures()
{
return pictures;
public Long getOrderState() {
return orderState;
}
public void setOrderState(Long orderState)
{
public void setOrderState(Long orderState) {
this.orderState = orderState;
}
public Long getOrderState()
{
return orderState;
}
public void setBillsType(Long billsType)
{
this.billsType = billsType;
public Long getBillsType() {
return billsType;
}
public Long getBillsType()
{
return billsType;
public void setBillsType(Long billsType) {
this.billsType = billsType;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("objid", getObjid())
.append("workOrder", getWorkOrder())
.append("deviceID", getDeviceID())
.append("faultType", getFaultType())
.append("operation", getOperation())
.append("remark", getRemark())
.append("pictures", getPictures())
.append("orderState", getOrderState())
.append("billsType", getBillsType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.toString();
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("objid", getObjid()).append("workOrder", getWorkOrder()).append("deviceID", getDeviceID()).append("faultType", getFaultType()).append("operation", getOperation()).append("remark", getRemark()).append("pictures", getPictures()).append("orderState", getOrderState()).append("billsType", getBillsType()).append("createBy", getCreateBy()).append("createTime", getCreateTime()).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);
}
}

@ -54,7 +54,6 @@
info.create_time,
info.update_by,
info.update_time,
open_password,
dbt.device_type_name,
dbt.default_price,

@ -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>

@ -1,22 +1,23 @@
<?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">
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.device.mapper.DeviceRepartBillsMapper">
<resultMap type="com.ruoyi.device.domain.DeviceRepartBills" id="DeviceRepartBillsResult">
<result property="objid" column="objid" />
<result property="workOrder" column="work_order" />
<result property="deviceID" column="deviceID" />
<result property="faultType" column="fault_type" />
<result property="operation" column="operation" />
<result property="remark" column="remark" />
<result property="pictures" column="pictures" />
<result property="orderState" column="order_state" />
<result property="billsType" column="bills_type" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="objid" column="objid"/>
<result property="workOrder" column="work_order"/>
<result property="deviceID" column="deviceID"/>
<result property="faultType" column="fault_type"/>
<result property="operation" column="operation"/>
<result property="remark" column="remark"/>
<result property="pictures" column="pictures"/>
<result property="orderState" column="order_state"/>
<result property="billsType" column="bills_type"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<association property="deviceInfo" resultMap="com.ruoyi.device.mapper.BaseInfoMapper.BaseInfoResult"/>
<association property="deviceBaseFault" resultMap="com.ruoyi.device.mapper.DeviceBaseFaultMapper.DeviceBaseFaultResult"/>
</resultMap>
<sql id="selectDeviceRepartBillsVo">
@ -25,36 +26,43 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
deviceID,
fault_type,
operation,
remark,
drb. remark,
pictures,
order_state,
bills_type,
drb.create_by,
drb.create_time,
bsd.device_id,device_name,manufacturer_id
device_name,
device_code,
fault_code,
fault_name
from device_repart_bills drb
left join base_scada_deviceinfo bsd on drb.deviceID = bsd.objid
left join device_base_info bsd on drb.deviceID = bsd.obj_id
left join bg_wheel_chocks.device_base_fault dbf on drb.fault_type = dbf.objid
</sql>
<select id="selectDeviceRepartBillsList" parameterType="com.ruoyi.device.domain.DeviceRepartBills" resultMap="DeviceRepartBillsResult">
<select id="selectDeviceRepartBillsList" parameterType="com.ruoyi.device.domain.DeviceRepartBills"
resultMap="DeviceRepartBillsResult">
<include refid="selectDeviceRepartBillsVo"/>
<where>
<if test="workOrder != null and workOrder != ''"> and work_order = #{workOrder}</if>
<if test="deviceID != null and deviceID != ''"> and deviceID = #{deviceID}</if>
<if test="faultType != null "> and fault_type = #{faultType}</if>
<if test="orderState != null "> and order_state = #{orderState}</if>
<where>
<if test="workOrder != null and workOrder != ''">and work_order = #{workOrder}</if>
<if test="deviceID != null and deviceID != ''">and deviceID = #{deviceID}</if>
<if test="faultType != null ">and fault_type = #{faultType}</if>
<if test="orderState != null ">and order_state = #{orderState}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != ''
and params.endCreateTime != null and params.endCreateTime != ''">
and drb.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
and drb.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
</where>
</select>
<select id="selectDeviceRepartBillsByObjid" parameterType="Long" resultMap="DeviceRepartBillsResult">
<include refid="selectDeviceRepartBillsVo"/>
where drb.objid = #{objid}
</select>
<insert id="insertDeviceRepartBills" parameterType="com.ruoyi.device.domain.DeviceRepartBills" useGeneratedKeys="true" keyProperty="objid">
<insert id="insertDeviceRepartBills" parameterType="com.ruoyi.device.domain.DeviceRepartBills"
useGeneratedKeys="true" keyProperty="objid">
insert into device_repart_bills
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="workOrder != null">work_order,</if>
@ -67,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="billsType != null">bills_type,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="workOrder != null">#{workOrder},</if>
<if test="deviceID != null">#{deviceID},</if>
@ -79,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="billsType != null">#{billsType},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</trim>
</insert>
<update id="updateDeviceRepartBills" parameterType="com.ruoyi.device.domain.DeviceRepartBills">
@ -100,11 +108,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<delete id="deleteDeviceRepartBillsByObjid" parameterType="Long">
delete from device_repart_bills where objid = #{objid}
delete
from device_repart_bills
where objid = #{objid}
</delete>
<delete id="deleteDeviceRepartBillsByObjids" parameterType="String">
delete from device_repart_bills where objid in
delete from device_repart_bills where objid in
<foreach item="objid" collection="array" open="(" separator="," close=")">
#{objid}
</foreach>

@ -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>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</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>

@ -0,0 +1,126 @@
<!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" th:object="${deviceRepartBills}">
<div class=" form-group">
<label class="col-sm-3 control-label">设备ID</label>
<div class="col-sm-8">
<!-- -->
<select id="deviceId" name="deviceId" class="form-control select2-multiple">
<option th:each="baseScadaDeviceInfo:${baseScadaDeviceInfos}"
th:value="${baseScadaDeviceInfo.uuid}"
th:text="${baseScadaDeviceInfo.deviceName}"
th:selected="${baseScadaDeviceInfo.uuid==deviceRepartBills.deviceID}"></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}"
th:selected="${base.objid==deviceRepartBills.deviceInfo.manufacturerId}"></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">
<input name="repairBillsCode" class="form-control" type="hidden" th:value="*{objid}">
</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
});
var name = $('#manufacturerName').select2('val');
if (name != null) {
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
}
//
})
}
})
$('#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>

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改委外工单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-repair_outsourcing-edit" th:object="${repairOutsourcing}">
<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="billsCode" th:field="*{billsCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">设备ID</label>
<div class="col-sm-8">
<input name="deviceId" th:field="*{deviceId}" 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="manufacturerName" th:field="*{manufacturerName}" 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="contacts" th:field="*{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" th:field="*{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">
<input name="reason" th:field="*{reason}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "device/repair_outsourcing";
$("#form-repair_outsourcing-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-repair_outsourcing-edit').serialize());
}
}
</script>
</body>
</html>

@ -0,0 +1,145 @@
<!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="billsCode"/>
</li>
<li>
<label>设备ID</label>
<input type="text" name="deviceId"/>
</li>
<li>
<label>委外单位:</label>
<input type="text" name="manufacturerName"/>
</li>
<li>
<label>申请人:</label>
<input type="text" name="createBy"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
class="fa fa-refresh"></i>&nbsp;重置</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:repair_outsourcing:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()"
shiro:hasPermission="device:repair_outsourcing:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"
shiro:hasPermission="device:repair_outsourcing:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()"
shiro:hasPermission="device:repair_outsourcing: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:repair_outsourcing:edit')}]];
var removeFlag = [[${@permission.hasPermi('device:repair_outsourcing:remove')}]];
var prefix = ctx + "device/repair_outsourcing";
$(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: 'billsCode',
title: '单号'
},
{
field: 'deviceId',
title: '设备ID',
visible: false
},
{
field: 'deviceInfo.deviceId',
title: '设备编号',
},
{
field: 'deviceInfo.deviceName',
title: '设备名称',
},
{
field: 'manufacturerName',
title: '委外单位'
},
{
field: 'contacts',
title: '联系人'
},
{
field: 'phone',
title: '联系方式'
},
{
field: 'reason',
title: '申请原因'
},
{
field: 'endDay',
title: '结束时间'
},
{
field: 'createBy',
title: '申请人'
},
{
field: 'createTime',
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>

@ -71,26 +71,26 @@
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
<div class="tabs-container">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">维修记录</a></li>
<li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="true">备件使用</a></li>
</ul>
<div class="tab-content">
<div id="tab-1" class="tab-pane active">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table1"></table>
</div>
</div>
<!-- <div class="tabs-container">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">维修记录</a></li>
<li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="true">备件使用</a></li>
</ul>
<div class="tab-content">
<div id="tab-1" class="tab-pane active">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table1"></table>
</div>
</div>
<div id="tab-2" class="tab-pane">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table2"></table>
</div>
</div>
<div id="tab-2" class="tab-pane">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table2"></table>
</div>
</div>
</div>
</div>
</div>
</div>-->
</div>
</div>
</div>
@ -129,7 +129,7 @@
visible: false
},
{
field: 'deviceInfo.deviceId',
field: 'deviceInfo.deviceCode',
title: '设备编号',
},
{
@ -139,10 +139,17 @@
{
field: 'faultType',
title: '故障类别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(faultTypeDatas, value);
}
visible: false
},
{
field: 'deviceBaseFault.faultCode',
title: '故障代码'
},
{
field: 'deviceBaseFault.faultName',
title: '故障类别'
},
{
field: 'operation',
title: '涉及操作'
@ -201,7 +208,7 @@
var ht = ''
url.forEach(function (value, i) {
console.log('第'+i+"="+value)
console.log('第' + i + "=" + value)
ht += "<img class='img-circle img-xs' data-height='540px' data-width='324px' data-target='self' src='" + value + "'/>"
// $.common.sprintf("<img class='img-circle img-xs' data-height='%s' data-width='%s' data-target='%s' src='%s'/>",h,m, 'self', value);
})
@ -214,14 +221,15 @@
//点击一行
function onClickRow(row, $element) {
initTable1(row.workOrder);
initTable2(row.workOrder);
// initTable1(row.workOrder);
// initTable2(row.workOrder);
}
function initTable1(bills) {
$('#bootstrap-table1').bootstrapTable('destroy');
$('#bootstrap-table1').bootstrapTable({
method: "post", //向服务器请求数据的方式
url: ctx + "device/repair_record/list/"+bills ,
url: ctx + "device/repair_record/list/" + bills,
striped: true, //表格显示条纹
pagination: false, //不启动分页
// queryParams: function (params) {
@ -232,7 +240,7 @@
// }
// },
sidePagination: "server",
queryParamsType : "",
queryParamsType: "",
columns: [
// {
// title: '',
@ -244,10 +252,10 @@
// }
// },
{
field:'index',
field: 'index',
title: '',
formatter: function (value, row, index) {
return index+1;
return index + 1;
}
},
{
@ -265,9 +273,9 @@
{
field: 'repairLength',
title: '维修时长(时)',
formatter:function (value, row, index) {
formatter: function (value, row, index) {
return (value/60).toFixed(2);
return (value / 60).toFixed(2);
}
},
{
@ -283,8 +291,8 @@
field: 'remark',
title: '内容'
}],
onLoadError: function(){ //加载失败时执行
layer.msg("加载数据失败", {time : 1500, icon : 2});
onLoadError: function () { //加载失败时执行
layer.msg("加载数据失败", {time: 1500, icon: 2});
}
});
@ -295,18 +303,18 @@
$('#bootstrap-table2').bootstrapTable('destroy');
$('#bootstrap-table2').bootstrapTable({
method: "post", //向服务器请求数据的方式
url: ctx + "device/record_repair_spare/list/"+bills ,
url: ctx + "device/record_repair_spare/list/" + bills,
striped: true, //表格显示条纹
pagination: false, //不启动分页
sidePagination: "server",
queryParamsType : "",
queryParamsType: "",
columns: [
{
field:'index',
field: 'index',
title: '',
formatter: function (value, row, index) {
return index+1;
return index + 1;
}
},
@ -347,8 +355,8 @@
field: 'createTime',
title: '使用时间'
}],
onLoadError: function(){ //加载失败时执行
layer.msg("加载数据失败", {time : 1500, icon : 2});
onLoadError: function () { //加载失败时执行
layer.msg("加载数据失败", {time: 1500, icon: 2});
}
});

Loading…
Cancel
Save