增加 轮挡维修
parent
f2f5029b2d
commit
35bd5312ef
@ -0,0 +1,124 @@
|
|||||||
|
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.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.device.domain.BaseDeviceManufacturer;
|
||||||
|
import com.ruoyi.device.service.IBaseManufacturerService;
|
||||||
|
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 wangh
|
||||||
|
* @date 2022-04-02
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/device/base_manufacturer")
|
||||||
|
public class BaseDeviceManufacturerController extends BaseController {
|
||||||
|
private String prefix = "device/base_manufacturer";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IBaseManufacturerService baseManufacturerService;
|
||||||
|
|
||||||
|
@RequiresPermissions("device:base_manufacturer:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String base_manufacturer() {
|
||||||
|
return prefix + "/base_manufacturer";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备生产厂家列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:base_manufacturer:list")
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list(BaseDeviceManufacturer baseDeviceManufacturer) {
|
||||||
|
startPage();
|
||||||
|
List<BaseDeviceManufacturer> list = baseManufacturerService.selectBaseManufacturerList(baseDeviceManufacturer);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出设备生产厂家列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:base_manufacturer:export")
|
||||||
|
@Log(title = "设备生产厂家", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(BaseDeviceManufacturer baseDeviceManufacturer) {
|
||||||
|
List<BaseDeviceManufacturer> list = baseManufacturerService.selectBaseManufacturerList(baseDeviceManufacturer);
|
||||||
|
ExcelUtil<BaseDeviceManufacturer> util = new ExcelUtil<BaseDeviceManufacturer>(BaseDeviceManufacturer.class);
|
||||||
|
return util.exportExcel(list, "设备生产厂家数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备生产厂家
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add() {
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存设备生产厂家
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:base_manufacturer:add")
|
||||||
|
@Log(title = "设备生产厂家", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(BaseDeviceManufacturer baseDeviceManufacturer) {
|
||||||
|
BaseDeviceManufacturer tag = baseManufacturerService.selectBaseManufacturerByName(baseDeviceManufacturer.getManufacturerName());
|
||||||
|
if (tag==null){
|
||||||
|
return toAjax(baseManufacturerService.insertBaseManufacturer(baseDeviceManufacturer));
|
||||||
|
}
|
||||||
|
return error("设备生产厂家名称重复");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备生产厂家
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:base_manufacturer:edit")
|
||||||
|
@GetMapping("/edit/{objid}")
|
||||||
|
public String edit(@PathVariable("objid") Long objid, ModelMap mmap) {
|
||||||
|
BaseDeviceManufacturer baseDeviceManufacturer = baseManufacturerService.selectBaseManufacturerByObjid(objid);
|
||||||
|
mmap.put("baseManufacturer", baseDeviceManufacturer);
|
||||||
|
return prefix + "/edit";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存设备生产厂家
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:base_manufacturer:edit")
|
||||||
|
@Log(title = "设备生产厂家", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(BaseDeviceManufacturer baseDeviceManufacturer) {
|
||||||
|
BaseDeviceManufacturer tag = baseManufacturerService.selectBaseManufacturerByName(baseDeviceManufacturer.getManufacturerName());
|
||||||
|
if (tag==null||tag.getObjid().equals(baseDeviceManufacturer.getObjid())){
|
||||||
|
return toAjax(baseManufacturerService.updateBaseManufacturer(baseDeviceManufacturer));
|
||||||
|
}
|
||||||
|
return error("设备生产厂家名称重复");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备生产厂家
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:base_manufacturer:remove")
|
||||||
|
@Log(title = "设备生产厂家", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping("/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids) {
|
||||||
|
return toAjax(baseManufacturerService.deleteBaseManufacturerByObjids(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.poi.ExcelUtil;
|
||||||
|
import com.ruoyi.device.domain.BaseDeviceManufacturer;
|
||||||
|
import com.ruoyi.device.domain.DeviceRepartBills;
|
||||||
|
import com.ruoyi.device.service.IBaseManufacturerService;
|
||||||
|
import com.ruoyi.device.service.IDeviceRepartBillsService;
|
||||||
|
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 ruoyi
|
||||||
|
* @date 2022-05-26
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/device/repart_bills")
|
||||||
|
public class RepartBillsController extends BaseController
|
||||||
|
{
|
||||||
|
private String prefix = "device/repart_bills";
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDeviceRepartBillsService deviceRepartBillsService;
|
||||||
|
// @Autowired
|
||||||
|
// private IBaseScadaDeviceInfoService baseScadaDeviceInfoService;
|
||||||
|
// private List<BaseInfo> baseScadaDeviceInfos;
|
||||||
|
@Autowired
|
||||||
|
private IBaseManufacturerService baseManufacturerService;
|
||||||
|
private List<BaseDeviceManufacturer> baseDeviceManufacturerList;
|
||||||
|
@RequiresPermissions("device:repart_bills:view")
|
||||||
|
@GetMapping()
|
||||||
|
public String repart_bills()
|
||||||
|
{
|
||||||
|
return prefix + "/repart_bills";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修工单列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repart_bills:list")
|
||||||
|
@PostMapping({"/list"})
|
||||||
|
@ResponseBody
|
||||||
|
public TableDataInfo list( DeviceRepartBills deviceRepartBills)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
|
||||||
|
List<DeviceRepartBills> list = deviceRepartBillsService.selectDeviceRepartBillsList(deviceRepartBills);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出维修工单列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repart_bills:export")
|
||||||
|
@Log(title = "维修工单", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult export(DeviceRepartBills deviceRepartBills)
|
||||||
|
{
|
||||||
|
List<DeviceRepartBills> list = deviceRepartBillsService.selectDeviceRepartBillsList(deviceRepartBills);
|
||||||
|
ExcelUtil<DeviceRepartBills> util = new ExcelUtil<DeviceRepartBills>(DeviceRepartBills.class);
|
||||||
|
return util.exportExcel(list, "维修工单数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增维修工单
|
||||||
|
*/
|
||||||
|
@GetMapping("/add")
|
||||||
|
public String add()
|
||||||
|
{
|
||||||
|
return prefix + "/add";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增保存维修工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repart_bills:add")
|
||||||
|
@Log(title = "维修工单", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult addSave(DeviceRepartBills deviceRepartBills)
|
||||||
|
{
|
||||||
|
return toAjax(deviceRepartBillsService.insertDeviceRepartBills(deviceRepartBills));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repart_bills:edit")
|
||||||
|
@GetMapping("/edit/{objid}")
|
||||||
|
public String edit(@PathVariable("objid") Long objid, ModelMap mmap)
|
||||||
|
{
|
||||||
|
DeviceRepartBills deviceRepartBills = deviceRepartBillsService.selectDeviceRepartBillsByObjid(objid);
|
||||||
|
mmap.put("deviceRepartBills", deviceRepartBills);
|
||||||
|
// return prefix + "/edit";
|
||||||
|
|
||||||
|
// if (baseScadaDeviceInfos == null || baseScadaDeviceInfos.isEmpty()) {
|
||||||
|
// baseScadaDeviceInfos = baseScadaDeviceInfoService.selectAllBaseScadaDeviceInfoList();
|
||||||
|
// }
|
||||||
|
// mmap.put("baseScadaDeviceInfos", baseScadaDeviceInfos);
|
||||||
|
if (baseDeviceManufacturerList == null || baseDeviceManufacturerList.isEmpty()) {
|
||||||
|
baseDeviceManufacturerList = baseManufacturerService.selectBaseManufacturerList(null);
|
||||||
|
}
|
||||||
|
mmap.put("baseManufacturerList", baseDeviceManufacturerList);
|
||||||
|
|
||||||
|
return "device/repair_outsourcing/add_device";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改保存维修工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repart_bills:edit")
|
||||||
|
@Log(title = "维修工单", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/edit")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult editSave(DeviceRepartBills deviceRepartBills)
|
||||||
|
{
|
||||||
|
return toAjax(deviceRepartBillsService.updateDeviceRepartBills(deviceRepartBills));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修工单
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("device:repart_bills:remove")
|
||||||
|
@Log(title = "维修工单", businessType = BusinessType.DELETE)
|
||||||
|
@PostMapping( "/remove")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult remove(String ids)
|
||||||
|
{
|
||||||
|
return toAjax(deviceRepartBillsService.deleteDeviceRepartBillsByObjids(ids));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
package com.ruoyi.device.domain;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备生产厂家对象 device_base_manufacturer
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2022-04-02
|
||||||
|
*/
|
||||||
|
public class BaseDeviceManufacturer extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long objid;
|
||||||
|
|
||||||
|
/** 厂商名称 */
|
||||||
|
@Excel(name = "厂商名称")
|
||||||
|
private String manufacturerName;
|
||||||
|
|
||||||
|
/** 联系电话 */
|
||||||
|
@Excel(name = "联系电话")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/** 联系人 */
|
||||||
|
@Excel(name = "联系人")
|
||||||
|
private String contacts;
|
||||||
|
|
||||||
|
/** 传真 */
|
||||||
|
@Excel(name = "传真")
|
||||||
|
private String fax;
|
||||||
|
|
||||||
|
/** 地址 */
|
||||||
|
@Excel(name = "地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/** 邮箱 */
|
||||||
|
@Excel(name = "邮箱")
|
||||||
|
private String mail;
|
||||||
|
|
||||||
|
public void setObjid(Long objid)
|
||||||
|
{
|
||||||
|
this.objid = objid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getObjid()
|
||||||
|
{
|
||||||
|
return objid;
|
||||||
|
}
|
||||||
|
public void setManufacturerName(String manufacturerName)
|
||||||
|
{
|
||||||
|
this.manufacturerName = manufacturerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getManufacturerName()
|
||||||
|
{
|
||||||
|
return manufacturerName;
|
||||||
|
}
|
||||||
|
public void setPhone(String phone)
|
||||||
|
{
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone()
|
||||||
|
{
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
public void setContacts(String contacts)
|
||||||
|
{
|
||||||
|
this.contacts = contacts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContacts()
|
||||||
|
{
|
||||||
|
return contacts;
|
||||||
|
}
|
||||||
|
public void setFax(String fax)
|
||||||
|
{
|
||||||
|
this.fax = fax;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFax()
|
||||||
|
{
|
||||||
|
return fax;
|
||||||
|
}
|
||||||
|
public void setAddress(String address)
|
||||||
|
{
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress()
|
||||||
|
{
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
public void setMail(String mail)
|
||||||
|
{
|
||||||
|
this.mail = mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMail()
|
||||||
|
{
|
||||||
|
return mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("objid", getObjid())
|
||||||
|
.append("manufacturerName", getManufacturerName())
|
||||||
|
.append("phone", getPhone())
|
||||||
|
.append("contacts", getContacts())
|
||||||
|
.append("fax", getFax())
|
||||||
|
.append("address", getAddress())
|
||||||
|
.append("mail", getMail())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.ruoyi.device.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.BaseDeviceManufacturer;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备生产厂家Mapper接口
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2022-04-02
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface BaseDeviceManufacturerMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询设备生产厂家
|
||||||
|
*
|
||||||
|
* @param objid 设备生产厂家主键
|
||||||
|
* @return 设备生产厂家
|
||||||
|
*/
|
||||||
|
public BaseDeviceManufacturer selectBaseManufacturerByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备生产厂家列表
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 设备生产厂家集合
|
||||||
|
*/
|
||||||
|
public List<BaseDeviceManufacturer> selectBaseManufacturerList(BaseDeviceManufacturer baseDeviceManufacturer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备生产厂家
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBaseManufacturer(BaseDeviceManufacturer baseDeviceManufacturer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备生产厂家
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBaseManufacturer(BaseDeviceManufacturer baseDeviceManufacturer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备生产厂家
|
||||||
|
*
|
||||||
|
* @param objid 设备生产厂家主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseManufacturerByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备生产厂家
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseManufacturerByObjids(String[] objids);
|
||||||
|
|
||||||
|
BaseDeviceManufacturer selectBaseManufacturerByName(String name);
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.device.mapper;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceRepartBills;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单Mapper接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-05-26
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface DeviceRepartBillsMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询维修工单
|
||||||
|
*
|
||||||
|
* @param objid 维修工单主键
|
||||||
|
* @return 维修工单
|
||||||
|
*/
|
||||||
|
public DeviceRepartBills selectDeviceRepartBillsByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修工单列表
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 维修工单集合
|
||||||
|
*/
|
||||||
|
public List<DeviceRepartBills> selectDeviceRepartBillsList(DeviceRepartBills deviceRepartBills);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增维修工单
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceRepartBills(DeviceRepartBills deviceRepartBills);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修工单
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceRepartBills(DeviceRepartBills deviceRepartBills);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修工单
|
||||||
|
*
|
||||||
|
* @param objid 维修工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRepartBillsByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除维修工单
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRepartBillsByObjids(String[] objids);
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.device.service;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.BaseDeviceManufacturer;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备生产厂家Service接口
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2022-04-02
|
||||||
|
*/
|
||||||
|
public interface IBaseManufacturerService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询设备生产厂家
|
||||||
|
*
|
||||||
|
* @param objid 设备生产厂家主键
|
||||||
|
* @return 设备生产厂家
|
||||||
|
*/
|
||||||
|
public BaseDeviceManufacturer selectBaseManufacturerByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备生产厂家列表
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 设备生产厂家集合
|
||||||
|
*/
|
||||||
|
public List<BaseDeviceManufacturer> selectBaseManufacturerList(BaseDeviceManufacturer baseDeviceManufacturer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备生产厂家
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertBaseManufacturer(BaseDeviceManufacturer baseDeviceManufacturer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备生产厂家
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateBaseManufacturer(BaseDeviceManufacturer baseDeviceManufacturer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备生产厂家
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的设备生产厂家主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseManufacturerByObjids(String objids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备生产厂家信息
|
||||||
|
*
|
||||||
|
* @param objid 设备生产厂家主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteBaseManufacturerByObjid(Long objid);
|
||||||
|
|
||||||
|
BaseDeviceManufacturer selectBaseManufacturerByName(String manufacturerName);
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.ruoyi.device.service;
|
||||||
|
|
||||||
|
import com.ruoyi.device.domain.DeviceRepartBills;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单Service接口
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-05-26
|
||||||
|
*/
|
||||||
|
public interface IDeviceRepartBillsService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询维修工单
|
||||||
|
*
|
||||||
|
* @param objid 维修工单主键
|
||||||
|
* @return 维修工单
|
||||||
|
*/
|
||||||
|
public DeviceRepartBills selectDeviceRepartBillsByObjid(Long objid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修工单列表
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 维修工单集合
|
||||||
|
*/
|
||||||
|
public List<DeviceRepartBills> selectDeviceRepartBillsList(DeviceRepartBills deviceRepartBills);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增维修工单
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceRepartBills(DeviceRepartBills deviceRepartBills);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修工单
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceRepartBills(DeviceRepartBills deviceRepartBills);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除维修工单
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的维修工单主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRepartBillsByObjids(String objids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修工单信息
|
||||||
|
*
|
||||||
|
* @param objid 维修工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRepartBillsByObjid(Long objid);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,106 @@
|
|||||||
|
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.BaseDeviceManufacturer;
|
||||||
|
import com.ruoyi.device.mapper.BaseDeviceManufacturerMapper;
|
||||||
|
import com.ruoyi.device.service.IBaseManufacturerService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备生产厂家Service业务层处理
|
||||||
|
*
|
||||||
|
* @author wangh
|
||||||
|
* @date 2022-04-02
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BaseDeviceManufacturerServiceImpl implements IBaseManufacturerService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private BaseDeviceManufacturerMapper baseManufacturerMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备生产厂家
|
||||||
|
*
|
||||||
|
* @param objid 设备生产厂家主键
|
||||||
|
* @return 设备生产厂家
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public BaseDeviceManufacturer selectBaseManufacturerByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return baseManufacturerMapper.selectBaseManufacturerByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询设备生产厂家列表
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 设备生产厂家
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<BaseDeviceManufacturer> selectBaseManufacturerList(BaseDeviceManufacturer baseDeviceManufacturer)
|
||||||
|
{
|
||||||
|
return baseManufacturerMapper.selectBaseManufacturerList(baseDeviceManufacturer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增设备生产厂家
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertBaseManufacturer(BaseDeviceManufacturer baseDeviceManufacturer)
|
||||||
|
{
|
||||||
|
baseDeviceManufacturer.setCreateTime(DateUtils.getNowDate());
|
||||||
|
baseDeviceManufacturer.setCreateBy(ShiroUtils.getLoginName());
|
||||||
|
return baseManufacturerMapper.insertBaseManufacturer(baseDeviceManufacturer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改设备生产厂家
|
||||||
|
*
|
||||||
|
* @param baseDeviceManufacturer 设备生产厂家
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateBaseManufacturer(BaseDeviceManufacturer baseDeviceManufacturer)
|
||||||
|
{
|
||||||
|
baseDeviceManufacturer.setUpdateBy(ShiroUtils.getLoginName());
|
||||||
|
baseDeviceManufacturer.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return baseManufacturerMapper.updateBaseManufacturer(baseDeviceManufacturer);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除设备生产厂家
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的设备生产厂家主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBaseManufacturerByObjids(String objids)
|
||||||
|
{
|
||||||
|
return baseManufacturerMapper.deleteBaseManufacturerByObjids(Convert.toStrArray(objids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除设备生产厂家信息
|
||||||
|
*
|
||||||
|
* @param objid 设备生产厂家主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteBaseManufacturerByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return baseManufacturerMapper.deleteBaseManufacturerByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BaseDeviceManufacturer selectBaseManufacturerByName(String manufacturerName) {
|
||||||
|
return baseManufacturerMapper.selectBaseManufacturerByName(manufacturerName);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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.device.domain.DeviceRepartBills;
|
||||||
|
import com.ruoyi.device.mapper.DeviceRepartBillsMapper;
|
||||||
|
import com.ruoyi.device.service.IDeviceRepartBillsService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 维修工单Service业务层处理
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
* @date 2022-05-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeviceRepartBillsServiceImpl implements IDeviceRepartBillsService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private DeviceRepartBillsMapper deviceRepartBillsMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修工单
|
||||||
|
*
|
||||||
|
* @param objid 维修工单主键
|
||||||
|
* @return 维修工单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DeviceRepartBills selectDeviceRepartBillsByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return deviceRepartBillsMapper.selectDeviceRepartBillsByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询维修工单列表
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 维修工单
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<DeviceRepartBills> selectDeviceRepartBillsList(DeviceRepartBills deviceRepartBills)
|
||||||
|
{
|
||||||
|
return deviceRepartBillsMapper.selectDeviceRepartBillsList(deviceRepartBills);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增维修工单
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertDeviceRepartBills(DeviceRepartBills deviceRepartBills)
|
||||||
|
{
|
||||||
|
deviceRepartBills.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return deviceRepartBillsMapper.insertDeviceRepartBills(deviceRepartBills);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改维修工单
|
||||||
|
*
|
||||||
|
* @param deviceRepartBills 维修工单
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateDeviceRepartBills(DeviceRepartBills deviceRepartBills)
|
||||||
|
{
|
||||||
|
return deviceRepartBillsMapper.updateDeviceRepartBills(deviceRepartBills);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除维修工单
|
||||||
|
*
|
||||||
|
* @param objids 需要删除的维修工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceRepartBillsByObjids(String objids)
|
||||||
|
{
|
||||||
|
return deviceRepartBillsMapper.deleteDeviceRepartBillsByObjids(Convert.toStrArray(objids));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除维修工单信息
|
||||||
|
*
|
||||||
|
* @param objid 维修工单主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceRepartBillsByObjid(Long objid)
|
||||||
|
{
|
||||||
|
return deviceRepartBillsMapper.deleteDeviceRepartBillsByObjid(objid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,22 +0,0 @@
|
|||||||
<?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.PdaApiMapper">
|
|
||||||
<select id="selectUseList" resultMap="com.ruoyi.device.mapper.RecordUseMapper.RecordUseResult">
|
|
||||||
SELECT
|
|
||||||
device_code,
|
|
||||||
device_name,
|
|
||||||
device_type,
|
|
||||||
open_time,
|
|
||||||
close_time,
|
|
||||||
use_state,
|
|
||||||
CASE
|
|
||||||
WHEN use_time = 0 or use_time is null THEN ROUND(TIMESTAMPDIFF(SECOND, open_time, NOW()) / 3600, 2)
|
|
||||||
ELSE use_time
|
|
||||||
END as use_time
|
|
||||||
FROM device_record_use order by open_time desc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<update id="updateRecord">
|
|
||||||
|
|
||||||
</update>
|
|
||||||
</mapper>
|
|
||||||
@ -0,0 +1,100 @@
|
|||||||
|
<?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.BaseDeviceManufacturerMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.device.domain.BaseDeviceManufacturer" id="BaseManufacturerResult">
|
||||||
|
<result property="objid" column="objid" />
|
||||||
|
<result property="manufacturerName" column="manufacturer_name" />
|
||||||
|
<result property="phone" column="phone" />
|
||||||
|
<result property="contacts" column="contacts" />
|
||||||
|
<result property="fax" column="fax" />
|
||||||
|
<result property="address" column="address" />
|
||||||
|
<result property="mail" column="mail" />
|
||||||
|
<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="selectBaseManufacturerVo">
|
||||||
|
select objid, manufacturer_name, phone, contacts, fax, address, mail, create_by, create_time, update_by, update_time from device_base_manufacturer
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectBaseManufacturerList" parameterType="BaseManufacturer" resultMap="BaseManufacturerResult">
|
||||||
|
<include refid="selectBaseManufacturerVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="manufacturerName != null and manufacturerName != ''"> and manufacturer_name like concat('%', #{manufacturerName}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectBaseManufacturerByObjid" parameterType="Long" resultMap="BaseManufacturerResult">
|
||||||
|
<include refid="selectBaseManufacturerVo"/>
|
||||||
|
where objid = #{objid}
|
||||||
|
</select>
|
||||||
|
<select id="selectBaseManufacturerByName" resultMap="BaseManufacturerResult">
|
||||||
|
<include refid="selectBaseManufacturerVo"/>
|
||||||
|
where manufacturer_name = #{name} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<insert id="insertBaseManufacturer" parameterType="BaseManufacturer" useGeneratedKeys="true" keyProperty="objid">
|
||||||
|
insert into device_base_manufacturer
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="manufacturerName != null">manufacturer_name,</if>
|
||||||
|
<if test="phone != null">phone,</if>
|
||||||
|
<if test="contacts != null">contacts,</if>
|
||||||
|
<if test="fax != null">fax,</if>
|
||||||
|
<if test="address != null">address,</if>
|
||||||
|
<if test="mail != null">mail,</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="manufacturerName != null">#{manufacturerName},</if>
|
||||||
|
<if test="phone != null">#{phone},</if>
|
||||||
|
<if test="contacts != null">#{contacts},</if>
|
||||||
|
<if test="fax != null">#{fax},</if>
|
||||||
|
<if test="address != null">#{address},</if>
|
||||||
|
<if test="mail != null">#{mail},</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="updateBaseManufacturer" parameterType="BaseManufacturer">
|
||||||
|
update device_base_manufacturer
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="manufacturerName != null">manufacturer_name = #{manufacturerName},</if>
|
||||||
|
<if test="phone != null">phone = #{phone},</if>
|
||||||
|
<if test="contacts != null">contacts = #{contacts},</if>
|
||||||
|
<if test="fax != null">fax = #{fax},</if>
|
||||||
|
<if test="address != null">address = #{address},</if>
|
||||||
|
<if test="mail != null">mail = #{mail},</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="deleteBaseManufacturerByObjid" parameterType="Long">
|
||||||
|
delete from device_base_manufacturer where objid = #{objid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteBaseManufacturerByObjids" parameterType="String">
|
||||||
|
delete from device_base_manufacturer where objid in
|
||||||
|
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,113 @@
|
|||||||
|
<?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.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" />
|
||||||
|
<association property="deviceInfo" resultMap="com.ruoyi.device.mapper.BaseInfoMapper.BaseInfoResult"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDeviceRepartBillsVo">
|
||||||
|
select drb.objid,
|
||||||
|
work_order,
|
||||||
|
deviceID,
|
||||||
|
fault_type,
|
||||||
|
operation,
|
||||||
|
remark,
|
||||||
|
pictures,
|
||||||
|
order_state,
|
||||||
|
bills_type,
|
||||||
|
drb.create_by,
|
||||||
|
drb.create_time,
|
||||||
|
bsd.device_id,device_name,manufacturer_id
|
||||||
|
from device_repart_bills drb
|
||||||
|
left join base_scada_deviceinfo bsd on drb.deviceID = bsd.objid
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</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 into device_repart_bills
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="workOrder != null">work_order,</if>
|
||||||
|
<if test="deviceID != null">deviceID,</if>
|
||||||
|
<if test="faultType != null">fault_type,</if>
|
||||||
|
<if test="operation != null">operation,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="pictures != null">pictures,</if>
|
||||||
|
<if test="orderState != null">order_state,</if>
|
||||||
|
<if test="billsType != null">bills_type,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="workOrder != null">#{workOrder},</if>
|
||||||
|
<if test="deviceID != null">#{deviceID},</if>
|
||||||
|
<if test="faultType != null">#{faultType},</if>
|
||||||
|
<if test="operation != null">#{operation},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="pictures != null">#{pictures},</if>
|
||||||
|
<if test="orderState != null">#{orderState},</if>
|
||||||
|
<if test="billsType != null">#{billsType},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDeviceRepartBills" parameterType="com.ruoyi.device.domain.DeviceRepartBills">
|
||||||
|
update device_repart_bills
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="workOrder != null">work_order = #{workOrder},</if>
|
||||||
|
<if test="deviceID != null">deviceID = #{deviceID},</if>
|
||||||
|
<if test="faultType != null">fault_type = #{faultType},</if>
|
||||||
|
<if test="operation != null">operation = #{operation},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="pictures != null">pictures = #{pictures},</if>
|
||||||
|
<if test="orderState != null">order_state = #{orderState},</if>
|
||||||
|
<if test="billsType != null">bills_type = #{billsType},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
where objid = #{objid}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceRepartBillsByObjid" parameterType="Long">
|
||||||
|
delete from device_repart_bills where objid = #{objid}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceRepartBillsByObjids" parameterType="String">
|
||||||
|
delete from device_repart_bills where objid in
|
||||||
|
<foreach item="objid" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objid}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
<?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.PdaApiMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.ruoyi.device.domain.RecordUse" id="RecordUseResult">
|
||||||
|
<result property="objId" column="obj_id" />
|
||||||
|
<result property="deviceId" column="device_id" />
|
||||||
|
<result property="deviceCode" column="device_code" />
|
||||||
|
<result property="baseDeviceCode" column="base_device_code" />
|
||||||
|
<result property="deviceName" column="device_name" />
|
||||||
|
<result property="deviceType" column="device_type" />
|
||||||
|
<result property="openTime" column="open_time" />
|
||||||
|
<result property="closeTime" column="close_time" />
|
||||||
|
<result property="useTime" column="use_time" />
|
||||||
|
<result property="defaultTime" column="default_time" />
|
||||||
|
<result property="chargePrice" column="charge_price" />
|
||||||
|
<result property="overtimeState" column="overtime_state" />
|
||||||
|
<result property="useState" column="use_state" />
|
||||||
|
<result property="useUser" column="use_user" />
|
||||||
|
<result property="useUnit" column="use_unit" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="queryYear" column="query_year" />
|
||||||
|
<result property="queryMonth" column="query_month" />
|
||||||
|
<result property="deptId" column="dept_id" />
|
||||||
|
<result property="userId" column="user_id" />
|
||||||
|
</resultMap>
|
||||||
|
<select id="selectUseList" resultMap="RecordUseResult">
|
||||||
|
SELECT
|
||||||
|
device_code,
|
||||||
|
device_name,
|
||||||
|
device_type,
|
||||||
|
open_time,
|
||||||
|
close_time,
|
||||||
|
use_state,
|
||||||
|
CASE
|
||||||
|
WHEN use_time = 0 or use_time is null THEN ROUND(TIMESTAMPDIFF(SECOND, open_time, NOW()) / 3600, 2)
|
||||||
|
ELSE use_time
|
||||||
|
END as use_time
|
||||||
|
FROM device_record_use order by open_time desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateRecord">
|
||||||
|
|
||||||
|
</update>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
<!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-base_manufacturer-add">
|
||||||
|
<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">
|
||||||
|
</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">
|
||||||
|
<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="fax" 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="address" 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="mail" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "device/base_manufacturer"
|
||||||
|
$("#form-base_manufacturer-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-base_manufacturer-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,122 @@
|
|||||||
|
<!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="manufacturerName"/>
|
||||||
|
</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:base_manufacturer:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="device:base_manufacturer:edit">
|
||||||
|
<i class="fa fa-edit"></i> 修改
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="device:base_manufacturer:remove">
|
||||||
|
<i class="fa fa-remove"></i> 删除
|
||||||
|
</a>
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="device:base_manufacturer: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:base_manufacturer:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('device:base_manufacturer:remove')}]];
|
||||||
|
var prefix = ctx + "device/base_manufacturer";
|
||||||
|
|
||||||
|
$(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: 'manufacturerName',
|
||||||
|
title: '厂商名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'phone',
|
||||||
|
title: '联系电话'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'contacts',
|
||||||
|
title: '联系人'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'fax',
|
||||||
|
title: '传真'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'address',
|
||||||
|
title: '地址'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'mail',
|
||||||
|
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,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-base_manufacturer-edit" th:object="${baseDeviceManufacturer}">
|
||||||
|
<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="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="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="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="fax" th:field="*{fax}" 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="address" th:field="*{address}" 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="mail" th:field="*{mail}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "device/base_manufacturer";
|
||||||
|
$("#form-base_manufacturer-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-base_manufacturer-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
<!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-repart_bills-add">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">维修单号:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="workOrder" 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="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">
|
||||||
|
<select name="faultType" class="form-control m-b" th:with="type=${@dict.getType('fault_category')}">
|
||||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">涉及操作:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="operation" 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="remark" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "device/repart_bills"
|
||||||
|
$("#form-repart_bills-add").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/add", $('#form-repart_bills-add').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,58 @@
|
|||||||
|
<!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-repart_bills-edit" th:object="${deviceRepartBills}">
|
||||||
|
<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="workOrder" th:field="*{workOrder}" 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="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">
|
||||||
|
<select name="faultType" class="form-control m-b" th:with="type=${@dict.getType('fault_category')}">
|
||||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{faultType}"></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-3 control-label">涉及操作:</label>
|
||||||
|
<div class="col-sm-8">
|
||||||
|
<input name="operation" th:field="*{operation}" 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="remark" th:field="*{remark}" class="form-control" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<th:block th:include="include :: footer" />
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var prefix = ctx + "device/repart_bills";
|
||||||
|
$("#form-repart_bills-edit").validate({
|
||||||
|
focusCleanup: true
|
||||||
|
});
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
if ($.validate.form()) {
|
||||||
|
$.operate.save(prefix + "/edit", $('#form-repart_bills-edit').serialize());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -0,0 +1,361 @@
|
|||||||
|
<!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="workOrder"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>设备编号:</label>
|
||||||
|
<input type="text" name="deviceID"/>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>故障类别:</label>
|
||||||
|
<select name="faultType" th:with="type=${@dict.getType('fault_category')}">
|
||||||
|
<option value="">所有</option>
|
||||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||||
|
th:value="${dict.dictValue}"></option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<label>工单状态:</label>
|
||||||
|
<select name="orderState" th:with="type=${@dict.getType('repart_bills_state')}">
|
||||||
|
<option value="">所有</option>
|
||||||
|
<option th:each="dict : ${type}" th:text="${dict.dictLabel}"
|
||||||
|
th:value="${dict.dictValue}"></option>
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
<li class="select-time">
|
||||||
|
<label>提报时间:</label>
|
||||||
|
<input type="text" class="time-input" id="startTime" placeholder="开始时间"
|
||||||
|
name="params[beginCreateTime]"/>
|
||||||
|
<span>-</span>
|
||||||
|
<input type="text" class="time-input" id="endTime" placeholder="结束时间"
|
||||||
|
name="params[endCreateTime]"/>
|
||||||
|
</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:repart_bills:add">
|
||||||
|
<i class="fa fa-plus"></i> 添加
|
||||||
|
</a>
|
||||||
|
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()"-->
|
||||||
|
<!-- shiro:hasPermission="device:repart_bills:edit">-->
|
||||||
|
<!-- <i class="fa fa-edit"></i> 修改-->
|
||||||
|
<!-- </a>-->
|
||||||
|
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"-->
|
||||||
|
<!-- shiro:hasPermission="device:repart_bills:remove">-->
|
||||||
|
<!-- <i class="fa fa-remove"></i> 删除-->
|
||||||
|
<!-- </a>-->
|
||||||
|
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="device:repart_bills:export">
|
||||||
|
<i class="fa fa-download"></i> 导出
|
||||||
|
</a>
|
||||||
|
</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 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>
|
||||||
|
<th:block th:include="include :: footer"/>
|
||||||
|
<script th:inline="javascript">
|
||||||
|
var editFlag = [[${@permission.hasPermi('device:repart_bills:edit')}]];
|
||||||
|
var removeFlag = [[${@permission.hasPermi('device:repart_bills:remove')}]];
|
||||||
|
var faultTypeDatas = [[${@dict.getType('fault_category')}]];
|
||||||
|
var orderStateDatas = [[${@dict.getType('repart_bills_state')}]];
|
||||||
|
var prefix = ctx + "device/repart_bills";
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
var options = {
|
||||||
|
url: prefix + "/list",
|
||||||
|
createUrl: prefix + "/add",
|
||||||
|
updateUrl: prefix + "/edit/{id}",
|
||||||
|
removeUrl: prefix + "/remove",
|
||||||
|
exportUrl: prefix + "/export",
|
||||||
|
modalName: "维修工单",
|
||||||
|
onClickRow: onClickRow,
|
||||||
|
columns: [{
|
||||||
|
checkbox: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'objid',
|
||||||
|
title: '主键',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'workOrder',
|
||||||
|
title: '维修单号'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'deviceID',
|
||||||
|
title: '设备编号',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'deviceInfo.deviceId',
|
||||||
|
title: '设备编号',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'deviceInfo.deviceName',
|
||||||
|
title: '设备名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'faultType',
|
||||||
|
title: '故障类别',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return $.table.selectDictLabel(faultTypeDatas, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'operation',
|
||||||
|
title: '涉及操作'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
title: '故障描述'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'pictures',
|
||||||
|
title: '照片',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
|
||||||
|
return imageView(value, 540, 324);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'orderState',
|
||||||
|
title: '状态',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return $.table.selectDictLabel(orderStateDatas, value);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'billsType',
|
||||||
|
title: '工单来源',
|
||||||
|
visible: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
|
//加载图片
|
||||||
|
function imageView(value, h, m) {
|
||||||
|
|
||||||
|
if (value != null) {
|
||||||
|
var url = value.split(',')
|
||||||
|
|
||||||
|
var ht = ''
|
||||||
|
url.forEach(function (value, i) {
|
||||||
|
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);
|
||||||
|
})
|
||||||
|
|
||||||
|
return ht
|
||||||
|
} else {
|
||||||
|
return '-'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//点击一行
|
||||||
|
function onClickRow(row, $element) {
|
||||||
|
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 ,
|
||||||
|
striped: true, //表格显示条纹
|
||||||
|
pagination: false, //不启动分页
|
||||||
|
// queryParams: function (params) {
|
||||||
|
// return {
|
||||||
|
// offset: params.offset,
|
||||||
|
// limit: params.limit,
|
||||||
|
// deviceId: deviceIdp
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
sidePagination: "server",
|
||||||
|
queryParamsType : "",
|
||||||
|
columns: [
|
||||||
|
// {
|
||||||
|
// title: '',
|
||||||
|
// width: 20,
|
||||||
|
// formatter: function (value, row, index) {
|
||||||
|
// // 显示行号
|
||||||
|
// var options = $('#bootstrap-table1').bootstrapTable('getOptions');
|
||||||
|
// return options.pageSize * (options.pageNumber - 1) + index + 1;
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
field:'index',
|
||||||
|
title: '',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return index+1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'billsCode',
|
||||||
|
title: '维修单号'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'startTime',
|
||||||
|
title: '开始时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'endTime',
|
||||||
|
title: '结束时间'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'repairLength',
|
||||||
|
title: '维修时长(时)',
|
||||||
|
formatter:function (value, row, index) {
|
||||||
|
|
||||||
|
return (value/60).toFixed(2);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createBy',
|
||||||
|
title: '维修人'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'repairType',
|
||||||
|
title: '维修类别'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
title: '内容'
|
||||||
|
}],
|
||||||
|
onLoadError: function(){ //加载失败时执行
|
||||||
|
layer.msg("加载数据失败", {time : 1500, icon : 2});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function initTable2(bills) {
|
||||||
|
$('#bootstrap-table2').bootstrapTable('destroy');
|
||||||
|
$('#bootstrap-table2').bootstrapTable({
|
||||||
|
method: "post", //向服务器请求数据的方式
|
||||||
|
url: ctx + "device/record_repair_spare/list/"+bills ,
|
||||||
|
striped: true, //表格显示条纹
|
||||||
|
pagination: false, //不启动分页
|
||||||
|
sidePagination: "server",
|
||||||
|
queryParamsType : "",
|
||||||
|
columns: [
|
||||||
|
|
||||||
|
{
|
||||||
|
field:'index',
|
||||||
|
title: '',
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
return index+1;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'workOrder',
|
||||||
|
title: '维修单号'
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
field: 'goodsCode',
|
||||||
|
title: '备件编码'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'goodsName',
|
||||||
|
title: '备件名称'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'specsName',
|
||||||
|
title: '规格'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'unitName',
|
||||||
|
title: '单位'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'price',
|
||||||
|
title: '价格'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'number',
|
||||||
|
title: '使用数量'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'remark',
|
||||||
|
title: '使用原因'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'createTime',
|
||||||
|
title: '使用时间'
|
||||||
|
}],
|
||||||
|
onLoadError: function(){ //加载失败时执行
|
||||||
|
layer.msg("加载数据失败", {time : 1500, icon : 2});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue