diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/controller/BaseDeviceManufacturerController.java b/ruoyi-device/src/main/java/com/ruoyi/device/controller/BaseDeviceManufacturerController.java new file mode 100644 index 0000000..9048a45 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/controller/BaseDeviceManufacturerController.java @@ -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 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 list = baseManufacturerService.selectBaseManufacturerList(baseDeviceManufacturer); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/controller/RepartBillsController.java b/ruoyi-device/src/main/java/com/ruoyi/device/controller/RepartBillsController.java new file mode 100644 index 0000000..f4380e3 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/controller/RepartBillsController.java @@ -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 baseScadaDeviceInfos; + @Autowired + private IBaseManufacturerService baseManufacturerService; + private List 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 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 list = deviceRepartBillsService.selectDeviceRepartBillsList(deviceRepartBills); + ExcelUtil util = new ExcelUtil(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)); + } + + +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/domain/BaseDeviceManufacturer.java b/ruoyi-device/src/main/java/com/ruoyi/device/domain/BaseDeviceManufacturer.java new file mode 100644 index 0000000..e3c4bb7 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/domain/BaseDeviceManufacturer.java @@ -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(); + } +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/domain/DeviceRepartBills.java b/ruoyi-device/src/main/java/com/ruoyi/device/domain/DeviceRepartBills.java new file mode 100644 index 0000000..3bcbf29 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/domain/DeviceRepartBills.java @@ -0,0 +1,147 @@ +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_repart_bills + * + * @author ruoyi + * @date 2022-05-26 + */ +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-转为外协 */ + @Excel(name = "工单状态 0-待维修,1-维修中,2-完成,3-转为外协") + private Long orderState; + + /** 工单来源 */ + @Excel(name = "工单来源") + private Long billsType; + private BaseInfo deviceInfo; + + public BaseInfo getDeviceInfo() { + return deviceInfo; + } + + public void setDeviceInfo(BaseInfo deviceInfo) { + this.deviceInfo = deviceInfo; + } + + public void setObjid(Long objid) + { + this.objid = objid; + } + + public Long getObjid() + { + return objid; + } + public void setWorkOrder(String workOrder) + { + this.workOrder = workOrder; + } + + public String getWorkOrder() + { + return workOrder; + } + public void setDeviceID(String deviceID) + { + this.deviceID = deviceID; + } + + public String getDeviceID() + { + return deviceID; + } + public void setFaultType(Long faultType) + { + this.faultType = faultType; + } + + public Long getFaultType() + { + return faultType; + } + public void setOperation(String operation) + { + this.operation = operation; + } + + public String getOperation() + { + return operation; + } + public void setPictures(String pictures) + { + this.pictures = pictures; + } + + public String getPictures() + { + return pictures; + } + 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; + } + + @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(); + } +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/mapper/BaseDeviceManufacturerMapper.java b/ruoyi-device/src/main/java/com/ruoyi/device/mapper/BaseDeviceManufacturerMapper.java new file mode 100644 index 0000000..9a255db --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/mapper/BaseDeviceManufacturerMapper.java @@ -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 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); +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/mapper/DeviceRepartBillsMapper.java b/ruoyi-device/src/main/java/com/ruoyi/device/mapper/DeviceRepartBillsMapper.java new file mode 100644 index 0000000..c95b58e --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/mapper/DeviceRepartBillsMapper.java @@ -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 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); +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/service/IBaseManufacturerService.java b/ruoyi-device/src/main/java/com/ruoyi/device/service/IBaseManufacturerService.java new file mode 100644 index 0000000..eb1fdc8 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/service/IBaseManufacturerService.java @@ -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 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); +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/service/IDeviceRepartBillsService.java b/ruoyi-device/src/main/java/com/ruoyi/device/service/IDeviceRepartBillsService.java new file mode 100644 index 0000000..077ec06 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/service/IDeviceRepartBillsService.java @@ -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 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); + + +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/service/impl/BaseDeviceManufacturerServiceImpl.java b/ruoyi-device/src/main/java/com/ruoyi/device/service/impl/BaseDeviceManufacturerServiceImpl.java new file mode 100644 index 0000000..b53cdc7 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/service/impl/BaseDeviceManufacturerServiceImpl.java @@ -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 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); + } +} diff --git a/ruoyi-device/src/main/java/com/ruoyi/device/service/impl/DeviceRepartBillsServiceImpl.java b/ruoyi-device/src/main/java/com/ruoyi/device/service/impl/DeviceRepartBillsServiceImpl.java new file mode 100644 index 0000000..b1bd7a5 --- /dev/null +++ b/ruoyi-device/src/main/java/com/ruoyi/device/service/impl/DeviceRepartBillsServiceImpl.java @@ -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 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); + } + + +} diff --git a/ruoyi-device/src/main/resources/PdaApiMapper.xml b/ruoyi-device/src/main/resources/PdaApiMapper.xml deleted file mode 100644 index fe6ed3d..0000000 --- a/ruoyi-device/src/main/resources/PdaApiMapper.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - diff --git a/ruoyi-device/src/main/resources/mapper/device/BaseDeviceManufacturerMapper.xml b/ruoyi-device/src/main/resources/mapper/device/BaseDeviceManufacturerMapper.xml new file mode 100644 index 0000000..6115011 --- /dev/null +++ b/ruoyi-device/src/main/resources/mapper/device/BaseDeviceManufacturerMapper.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + select objid, manufacturer_name, phone, contacts, fax, address, mail, create_by, create_time, update_by, update_time from device_base_manufacturer + + + + + + + + + + insert into device_base_manufacturer + + manufacturer_name, + phone, + contacts, + fax, + address, + mail, + create_by, + create_time, + update_by, + update_time, + + + #{manufacturerName}, + #{phone}, + #{contacts}, + #{fax}, + #{address}, + #{mail}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update device_base_manufacturer + + manufacturer_name = #{manufacturerName}, + phone = #{phone}, + contacts = #{contacts}, + fax = #{fax}, + address = #{address}, + mail = #{mail}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where objid = #{objid} + + + + delete from device_base_manufacturer where objid = #{objid} + + + + delete from device_base_manufacturer where objid in + + #{objid} + + + + + + \ No newline at end of file diff --git a/ruoyi-device/src/main/resources/mapper/device/DeviceRepartBillsMapper.xml b/ruoyi-device/src/main/resources/mapper/device/DeviceRepartBillsMapper.xml new file mode 100644 index 0000000..bf3cd8c --- /dev/null +++ b/ruoyi-device/src/main/resources/mapper/device/DeviceRepartBillsMapper.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + 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 + + + + + + + + insert into device_repart_bills + + work_order, + deviceID, + fault_type, + operation, + remark, + pictures, + order_state, + bills_type, + create_by, + create_time, + + + #{workOrder}, + #{deviceID}, + #{faultType}, + #{operation}, + #{remark}, + #{pictures}, + #{orderState}, + #{billsType}, + #{createBy}, + #{createTime}, + + + + + update device_repart_bills + + work_order = #{workOrder}, + deviceID = #{deviceID}, + fault_type = #{faultType}, + operation = #{operation}, + remark = #{remark}, + pictures = #{pictures}, + order_state = #{orderState}, + bills_type = #{billsType}, + create_by = #{createBy}, + create_time = #{createTime}, + + where objid = #{objid} + + + + delete from device_repart_bills where objid = #{objid} + + + + delete from device_repart_bills where objid in + + #{objid} + + + + \ No newline at end of file diff --git a/ruoyi-device/src/main/resources/mapper/device/PdaApiMapper.xml b/ruoyi-device/src/main/resources/mapper/device/PdaApiMapper.xml new file mode 100644 index 0000000..64a1fae --- /dev/null +++ b/ruoyi-device/src/main/resources/mapper/device/PdaApiMapper.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ruoyi-device/src/main/resources/templates/device/base_manufacturer/add.html b/ruoyi-device/src/main/resources/templates/device/base_manufacturer/add.html new file mode 100644 index 0000000..5be9cc7 --- /dev/null +++ b/ruoyi-device/src/main/resources/templates/device/base_manufacturer/add.html @@ -0,0 +1,61 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-device/src/main/resources/templates/device/base_manufacturer/base_manufacturer.html b/ruoyi-device/src/main/resources/templates/device/base_manufacturer/base_manufacturer.html new file mode 100644 index 0000000..a439b3a --- /dev/null +++ b/ruoyi-device/src/main/resources/templates/device/base_manufacturer/base_manufacturer.html @@ -0,0 +1,122 @@ + + + + + + +
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-device/src/main/resources/templates/device/base_manufacturer/edit.html b/ruoyi-device/src/main/resources/templates/device/base_manufacturer/edit.html new file mode 100644 index 0000000..5b9fcd7 --- /dev/null +++ b/ruoyi-device/src/main/resources/templates/device/base_manufacturer/edit.html @@ -0,0 +1,62 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-device/src/main/resources/templates/device/repart_bills/add.html b/ruoyi-device/src/main/resources/templates/device/repart_bills/add.html new file mode 100644 index 0000000..bf5c2f7 --- /dev/null +++ b/ruoyi-device/src/main/resources/templates/device/repart_bills/add.html @@ -0,0 +1,57 @@ + + + + + + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-device/src/main/resources/templates/device/repart_bills/edit.html b/ruoyi-device/src/main/resources/templates/device/repart_bills/edit.html new file mode 100644 index 0000000..551b3f2 --- /dev/null +++ b/ruoyi-device/src/main/resources/templates/device/repart_bills/edit.html @@ -0,0 +1,58 @@ + + + + + + +
+
+ +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/ruoyi-device/src/main/resources/templates/device/repart_bills/repart_bills.html b/ruoyi-device/src/main/resources/templates/device/repart_bills/repart_bills.html new file mode 100644 index 0000000..a3c7768 --- /dev/null +++ b/ruoyi-device/src/main/resources/templates/device/repart_bills/repart_bills.html @@ -0,0 +1,361 @@ + + + + + + +
+
+
+
+
+
    +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + +
  • +
  • + + + - + +
  • +
  • +  搜索 +  重置 +
  • +
+
+
+
+ +
+ + 添加 + + + + + + + + + + + 导出 + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+
+
+ + + + \ No newline at end of file