新增设备管理模块

This commit is contained in:
2025-09-24 13:29:10 +08:00
parent f278056c80
commit 069c1664ca
111 changed files with 11916 additions and 1 deletions

View File

@@ -0,0 +1,103 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.poi.ExcelUtil;
import com.gear.mes.dv.domain.DvCheckMachinery;
import com.gear.mes.dv.service.IDvCheckMachineryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 点检设备Controller
*
* @author yinjinlu
* @date 2022-06-17
*/
@RestController
@RequestMapping("/mes/dv/checkmachinery")
public class DvCheckMachineryController extends BaseController
{
@Autowired
private IDvCheckMachineryService dvCheckMachineryService;
/**
* 查询点检设备列表
*/
@GetMapping("/list")
public TableDataInfo list(DvCheckMachinery dvCheckMachinery)
{
startPage();
List<DvCheckMachinery> list = dvCheckMachineryService.selectDvCheckMachineryList(dvCheckMachinery);
return getDataTable(list);
}
/**
* 导出点检设备列表
*/
@Log(title = "点检设备", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvCheckMachinery dvCheckMachinery)
{
List<DvCheckMachinery> list = dvCheckMachineryService.selectDvCheckMachineryList(dvCheckMachinery);
ExcelUtil.exportExcel(list, "点检设备数据", DvCheckMachinery.class, response);
}
/**
* 获取点检设备详细信息
*/
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
{
return AjaxResult.success(dvCheckMachineryService.selectDvCheckMachineryByRecordId(recordId));
}
/**
* 新增点检设备
*/
@Log(title = "点检设备", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvCheckMachinery dvCheckMachinery)
{
if(UserConstants.NOT_UNIQUE.equals(dvCheckMachineryService.checkMachineryUnique(dvCheckMachinery))){
return R.fail("设备已设置过点检计划!");
}
return toAjax(dvCheckMachineryService.insertDvCheckMachinery(dvCheckMachinery));
}
/**
* 修改点检设备
*/
@Log(title = "点检设备", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvCheckMachinery dvCheckMachinery)
{
if(UserConstants.NOT_UNIQUE.equals(dvCheckMachineryService.checkMachineryUnique(dvCheckMachinery))){
return R.fail("设备已设置过点检计划!");
}
return toAjax(dvCheckMachineryService.updateDvCheckMachinery(dvCheckMachinery));
}
/**
* 删除点检设备
*/
@Log(title = "点检设备", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public R<Void> remove(@PathVariable Long[] recordIds)
{
return toAjax(dvCheckMachineryService.deleteDvCheckMachineryByRecordIds(recordIds));
}
}

View File

@@ -0,0 +1,155 @@
package com.gear.mes.dv.controller;
import cn.hutool.core.collection.CollUtil;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.poi.ExcelUtil;
import com.gear.mes.dv.domain.DvCheckMachinery;
import com.gear.mes.dv.domain.DvCheckPlan;
import com.gear.mes.dv.domain.DvCheckSubject;
import com.gear.mes.dv.domain.dto.DvCheckPlanDTO;
import com.gear.mes.dv.service.IDvCheckMachineryService;
import com.gear.mes.dv.service.IDvCheckPlanService;
import com.gear.mes.dv.service.IDvCheckSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备点检计划头Controller
*
* @author yinjinlu
* @date 2022-06-16
*/
@RestController
@RequestMapping("/mes/dv/checkplan")
public class DvCheckPlanController extends BaseController
{
@Autowired
private IDvCheckPlanService dvCheckPlanService;
@Autowired
IDvCheckMachineryService dvCheckMachineryService;
@Autowired
IDvCheckSubjectService dvCheckSubjectService;
/**
* 查询设备点检计划头列表
*/
@GetMapping("/list")
public TableDataInfo list(DvCheckPlan dvCheckPlan)
{
startPage();
List<DvCheckPlan> list = dvCheckPlanService.selectDvCheckPlanList(dvCheckPlan);
return getDataTable(list);
}
/**
* 导出设备点检计划头列表
*/
@Log(title = "设备点检计划头", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvCheckPlan dvCheckPlan)
{
List<DvCheckPlan> list = dvCheckPlanService.selectDvCheckPlanList(dvCheckPlan);
ExcelUtil.exportExcel(list, "设备点检计划头数据", DvCheckPlan.class, response);
}
/**
* 获取设备点检计划头详细信息
*/
@GetMapping(value = "/{planId}")
public AjaxResult getInfo(@PathVariable("planId") Long planId)
{
return AjaxResult.success(dvCheckPlanService.selectDvCheckPlanByPlanId(planId));
}
/**
* 新增设备点检计划头
*/
@Log(title = "设备点检计划头", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvCheckPlan dvCheckPlan)
{
if(UserConstants.NOT_UNIQUE.equals(dvCheckPlanService.checkPlanCodeUnique(dvCheckPlan))){
return R.fail("编号已存在!");
}
return toAjax(dvCheckPlanService.insertDvCheckPlan(dvCheckPlan));
}
/**
* 修改设备点检计划头
*/
@Log(title = "设备点检计划头", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvCheckPlan dvCheckPlan)
{
if(UserConstants.NOT_UNIQUE.equals(dvCheckPlanService.checkPlanCodeUnique(dvCheckPlan))){
return R.fail("编号已存在!");
}
if(UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckPlan.getStatus())){
DvCheckMachinery para1 = new DvCheckMachinery();
para1.setPlanId(dvCheckPlan.getPlanId());
List<DvCheckMachinery> machinerys = dvCheckMachineryService.selectDvCheckMachineryList(para1);
if(!CollUtil.isNotEmpty(machinerys)){
return R.fail("请指定设备!");
}
DvCheckSubject para2 = new DvCheckSubject();
para2.setPlanId(dvCheckPlan.getPlanId());
List<DvCheckSubject> subjects = dvCheckSubjectService.selectDvCheckSubjectList(para2);
if(!CollUtil.isNotEmpty(subjects)){
return R.fail("请指定项目!");
}
}
return toAjax(dvCheckPlanService.updateDvCheckPlan(dvCheckPlan));
}
/**
* 删除设备点检计划头
*/
@Log(title = "设备点检计划头", businessType = BusinessType.DELETE)
@Transactional
@DeleteMapping("/{planIds}")
public R<Void> remove(@PathVariable Long[] planIds)
{
for (Long planId:planIds
) {
DvCheckPlan plan = dvCheckPlanService.selectDvCheckPlanByPlanId(planId);
if(!UserConstants.ORDER_STATUS_PREPARE.equals(plan.getStatus())){
return R.fail("只能删除草稿状态单据!");
}
dvCheckMachineryService.deleteByPlanId(planId);
dvCheckSubjectService.deleteByPlanId(planId);
}
return toAjax(dvCheckPlanService.deleteDvCheckPlanByPlanIds(planIds));
}
/**
* 根据设备编码和计划类型查询设备点检计划头列表
* @return
*/
@GetMapping("/getCheckPlan")
public AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO) {
return dvCheckPlanService.getCheckPlan(checkPlanDTO);
}
}

View File

@@ -0,0 +1,168 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.poi.ExcelUtil;
import com.gear.mes.dv.domain.DvCheckRecord;
import com.gear.mes.dv.domain.DvCheckRecordLine;
import com.gear.mes.dv.domain.DvCheckSubject;
import com.gear.mes.dv.service.IDvCheckRecordLineService;
import com.gear.mes.dv.service.IDvCheckRecordService;
import com.gear.mes.dv.service.IDvCheckSubjectService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备点检记录Controller
*
* @author yinjinlu
* @date 2024-12-26
*/
@RestController
@RequestMapping("/mes/dv/checkrecord")
public class DvCheckRecordController extends BaseController
{
@Autowired
private IDvCheckRecordService dvCheckRecordService;
@Autowired
private IDvCheckSubjectService dvCheckSubjectService;
@Autowired
private IDvCheckRecordLineService dvCheckRecordLineService;
/**
* 查询设备点检记录列表
*/
@GetMapping("/list")
public TableDataInfo list(DvCheckRecord dvCheckRecord)
{
startPage();
List<DvCheckRecord> list = dvCheckRecordService.selectDvCheckRecordList(dvCheckRecord);
return getDataTable(list);
}
/**
* 导出设备点检记录列表
*/
@Log(title = "设备点检记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvCheckRecord dvCheckRecord)
{
List<DvCheckRecord> list = dvCheckRecordService.selectDvCheckRecordList(dvCheckRecord);
ExcelUtil.exportExcel(list, "设备点检记录数据", DvCheckRecord.class, response);
}
/**
* 获取设备点检记录详细信息
*/
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
{
return AjaxResult.success(dvCheckRecordService.selectDvCheckRecordByRecordId(recordId));
}
/**
* 新增设备点检记录
*/
@Log(title = "设备点检记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DvCheckRecord dvCheckRecord)
{
dvCheckRecordService.insertDvCheckRecord(dvCheckRecord);
if(dvCheckRecord.getPlanId()!= null){
//根据选择的点检计划自动生成对应的行信息
DvCheckSubject param = new DvCheckSubject();
param.setPlanId(dvCheckRecord.getPlanId());
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
if(!CollectionUtils.isEmpty(subjectList)){
for(DvCheckSubject subject : subjectList){
DvCheckRecordLine line = new DvCheckRecordLine();
line.setRecordId(dvCheckRecord.getRecordId());
line.setSubjectId(subject.getSubjectId());
line.setSubjectName(subject.getSubjectName());
line.setSubjectType(subject.getSubjectType());
line.setSubjectContent(subject.getSubjectContent());
line.setSubjectStandard(subject.getSubjectStandard());
line.setCheckStatus(UserConstants.YES);
}
}
}
return AjaxResult.success(dvCheckRecord.getRecordId());
}
/**
* 修改设备点检记录
*/
@Log(title = "设备点检记录", businessType = BusinessType.UPDATE)
@Transactional
@PutMapping
public R<Void> edit(@RequestBody DvCheckRecord dvCheckRecord)
{
if(UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckRecord.getStatus())){
DvCheckRecordLine param = new DvCheckRecordLine();
param.setRecordId(dvCheckRecord.getRecordId());
List<DvCheckRecordLine> lineList = dvCheckRecordLineService.selectDvCheckRecordLineList(param);
if(CollectionUtils.isEmpty(lineList)){
return R.fail("请添加设备点检项目结果信息");
}
}
DvCheckRecord oldRecord = dvCheckRecordService.selectDvCheckRecordByRecordId(dvCheckRecord.getRecordId());
if(oldRecord.getPlanId() != null && dvCheckRecord.getPlanId() != null && !dvCheckRecord.getPlanId().equals(oldRecord.getPlanId())){
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(dvCheckRecord.getRecordId());
//根据选择的点检计划自动生成对应的行信息
DvCheckSubject param = new DvCheckSubject();
param.setPlanId(dvCheckRecord.getPlanId());
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
if(!CollectionUtils.isEmpty(subjectList)){
for(DvCheckSubject subject : subjectList){
DvCheckRecordLine line = new DvCheckRecordLine();
line.setRecordId(dvCheckRecord.getRecordId());
line.setSubjectId(subject.getSubjectId());
line.setSubjectName(subject.getSubjectName());
line.setSubjectType(subject.getSubjectType());
line.setSubjectContent(subject.getSubjectContent());
line.setSubjectStandard(subject.getSubjectStandard());
line.setCheckStatus(UserConstants.YES);
}
}
}
return toAjax(dvCheckRecordService.updateDvCheckRecord(dvCheckRecord));
}
/**
* 删除设备点检记录
*/
@Log(title = "设备点检记录", businessType = BusinessType.DELETE)
@Transactional
@DeleteMapping("/{recordIds}")
public R<Void> remove(@PathVariable Long[] recordIds)
{
for(Long recordId : recordIds){
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(recordId);
}
return toAjax(dvCheckRecordService.deleteDvCheckRecordByRecordIds(recordIds));
}
}

View File

@@ -0,0 +1,100 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.poi.ExcelUtil;
import com.gear.mes.dv.domain.DvCheckRecordLine;
import com.gear.mes.dv.service.IDvCheckRecordLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备点检记录行Controller
*
* @author yinjinlu
* @date 2024-12-26
*/
@RestController
@RequestMapping("/mes/dv/checkrecordline")
public class DvCheckRecordLineController extends BaseController
{
@Autowired
private IDvCheckRecordLineService dvCheckRecordLineService;
/**
* 查询设备点检记录行列表
*/
@GetMapping("/list")
public TableDataInfo list(DvCheckRecordLine dvCheckRecordLine)
{
startPage();
List<DvCheckRecordLine> list = dvCheckRecordLineService.selectDvCheckRecordLineList(dvCheckRecordLine);
return getDataTable(list);
}
/**
* 导出设备点检记录行列表
*/
@Log(title = "设备点检记录行", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvCheckRecordLine dvCheckRecordLine)
{
List<DvCheckRecordLine> list = dvCheckRecordLineService.selectDvCheckRecordLineList(dvCheckRecordLine);
ExcelUtil.exportExcel(list, "设备点检记录行数据", DvCheckRecordLine.class, response);
}
/**
* 获取设备点检记录行详细信息
*/
@GetMapping(value = "/{lineId}")
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
{
return AjaxResult.success(dvCheckRecordLineService.selectDvCheckRecordLineByLineId(lineId));
}
/**
* 新增设备点检记录行
*/
@Log(title = "设备点检记录行", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvCheckRecordLine dvCheckRecordLine)
{
return toAjax(dvCheckRecordLineService.insertDvCheckRecordLine(dvCheckRecordLine));
}
/**
* 修改设备点检记录行
*/
@Log(title = "设备点检记录行", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvCheckRecordLine dvCheckRecordLine)
{
return toAjax(dvCheckRecordLineService.updateDvCheckRecordLine(dvCheckRecordLine));
}
/**
* 删除设备点检记录行
*/
@Log(title = "设备点检记录行", businessType = BusinessType.DELETE)
@DeleteMapping("/{lineIds}")
public R<Void> remove(@PathVariable Long[] lineIds)
{
return toAjax(dvCheckRecordLineService.deleteDvCheckRecordLineByLineIds(lineIds));
}
}

View File

@@ -0,0 +1,105 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.poi.ExcelUtil;
import com.gear.mes.dv.domain.DvCheckSubject;
import com.gear.mes.dv.service.IDvCheckSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 点检项目Controller
*
* @author yinjinlu
* @date 2022-06-18
*/
@RestController
@RequestMapping("/mes/dv/checksubject")
public class DvCheckSubjectController extends BaseController
{
@Autowired
private IDvCheckSubjectService dvCheckSubjectService;
/**
* 查询点检项目列表
*/
@GetMapping("/list")
public TableDataInfo list(DvCheckSubject dvCheckSubject)
{
startPage();
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
return getDataTable(list);
}
/**
* 导出点检项目列表
*/
@Log(title = "点检项目", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvCheckSubject dvCheckSubject)
{
List<DvCheckSubject> list = dvCheckSubjectService.selectDvCheckSubjectList(dvCheckSubject);
ExcelUtil.exportExcel(list, "点检项目数据", DvCheckSubject.class, response);
}
/**
* 获取点检项目详细信息
*/
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
{
return AjaxResult.success(dvCheckSubjectService.selectDvCheckSubjectByRecordId(recordId));
}
/**
* 新增点检项目
*/
@Log(title = "点检项目", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvCheckSubject dvCheckSubject)
{
if(UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))){
return R.fail("点检项目已经添加过!");
}
return toAjax(dvCheckSubjectService.insertDvCheckSubject(dvCheckSubject));
}
/**
* 修改点检项目
*/
@Log(title = "点检项目", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvCheckSubject dvCheckSubject)
{
if(UserConstants.NOT_UNIQUE.equals(dvCheckSubjectService.checkSubjectUnique(dvCheckSubject))){
return R.fail("点检项目已经添加过!");
}
return toAjax(dvCheckSubjectService.updateDvCheckSubject(dvCheckSubject));
}
/**
* 删除点检项目
*/
@Log(title = "点检项目", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public R<Void> remove(@PathVariable Long[] recordIds)
{
return toAjax(dvCheckSubjectService.deleteDvCheckSubjectByRecordIds(recordIds));
}
}

View File

@@ -0,0 +1,128 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.excel.ExcelUtil;
import com.gear.mes.dv.domain.DvMachinery;
import com.gear.mes.dv.service.IDvMachineryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备Controller
*
* @author yinjinlu
* @date 2022-05-08
*/
@RestController
@RequestMapping("/mes/dv/machinery")
public class DvMachineryController extends BaseController
{
@Autowired
private IDvMachineryService dvMachineryService;
/**
* 查询设备列表
*/
@GetMapping("/list")
public TableDataInfo list(DvMachinery dvMachinery)
{
startPage();
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
return getDataTable(list);
}
/**
* 导出设备列表
*/
@Log(title = "设备", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvMachinery dvMachinery)
{
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
ExcelUtil<DvMachinery> util = new ExcelUtil<DvMachinery>(DvMachinery.class);
util.exportExcel(response, list, "设备数据");
}
/**
* 获取设备详细信息
*/
@GetMapping(value = "/{machineryId}")
public AjaxResult getInfo(@PathVariable("machineryId") Long machineryId)
{
return AjaxResult.success(dvMachineryService.selectDvMachineryByMachineryId(machineryId));
}
/**
* 新增设备
*/
@Log(title = "设备", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DvMachinery dvMachinery)
{
if(UserConstants.NOT_UNIQUE.equals(dvMachineryService.checkRecptCodeUnique(dvMachinery))){
return AjaxResult.error("编号已存在!");
}
return dvMachineryService.insertDvMachinery(dvMachinery);
}
/**
* 修改设备
*/
@Log(title = "设备", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DvMachinery dvMachinery)
{
if(UserConstants.NOT_UNIQUE.equals(dvMachineryService.checkRecptCodeUnique(dvMachinery))){
return AjaxResult.error("编号已存在!");
}
return dvMachineryService.updateDvMachinery(dvMachinery);
}
/**
* 删除设备
*/
@Log(title = "设备", businessType = BusinessType.DELETE)
@DeleteMapping("/{machineryIds}")
public R<Void> remove(@PathVariable Long[] machineryIds)
{
return toAjax(dvMachineryService.deleteDvMachineryByMachineryIds(machineryIds));
}
// /**
// * 依据上传的文件批量更新或新增设备
// */
//
// @Log(title = "设备", businessType = BusinessType.IMPORT)
// @PostMapping("/importData")
// public AjaxResult importData(MultipartFile file,
// @RequestParam(name = "updateSupport", defaultValue = "false") boolean updateSupport) throws Exception {
// ExcelUtil<DvMachinery> util = new ExcelUtil<>(DvMachinery.class);
// List<DvMachinery> dvMachineryList = util.importExcel(file.getInputStream());
// String operName = LoginHelper.getUsername();
// String message = dvMachineryService.importMachinery(dvMachineryList, updateSupport, operName);
// return AjaxResult.success(message);
// }
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response)
{
ExcelUtil<DvMachinery> util = new ExcelUtil<DvMachinery>(DvMachinery.class);
util.importTemplateExcel(response, "设备台账");
}
}

View File

@@ -0,0 +1,114 @@
package com.gear.mes.dv.controller;
import cn.hutool.core.collection.CollUtil;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.enums.BusinessType;
import com.gear.common.excel.ExcelUtil;
import com.gear.mes.dv.domain.DvMachinery;
import com.gear.mes.dv.domain.DvMachineryType;
import com.gear.mes.dv.service.IDvMachineryService;
import com.gear.mes.dv.service.IDvMachineryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.UUID;
/**
* 设备类型Controller
*
* @author yinjinlu
* @date 2022-05-08
*/
@RestController
@RequestMapping("/mes/dv/machinerytype")
public class DvMachineryTypeController extends BaseController
{
@Autowired
private IDvMachineryTypeService dvMachineryTypeService;
@Autowired
private IDvMachineryService dvMachineryService;
/**
* 查询设备类型列表
*/
@GetMapping("/list")
public AjaxResult list(DvMachineryType dvMachineryType)
{
List<DvMachineryType> list = dvMachineryTypeService.selectDvMachineryTypeList(dvMachineryType);
return AjaxResult.success(list);
}
/**
* 导出设备类型列表
*/
@Log(title = "设备类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvMachineryType dvMachineryType)
{
List<DvMachineryType> list = dvMachineryTypeService.selectDvMachineryTypeList(dvMachineryType);
ExcelUtil<DvMachineryType> util = new ExcelUtil<DvMachineryType>(DvMachineryType.class);
util.exportExcel(response, list, "设备类型数据");
}
/**
* 获取设备类型详细信息
*/
@GetMapping(value = "/{machineryTypeId}")
public AjaxResult getInfo(@PathVariable("machineryTypeId") Long machineryTypeId)
{
return AjaxResult.success(dvMachineryTypeService.selectDvMachineryTypeByMachineryTypeId(machineryTypeId));
}
/**
* 新增设备类型
*/
@Log(title = "设备类型", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvMachineryType dvMachineryType)
{
// 使用UUID生成设备类型编号
String machineryTypeCode = "MT-" + UUID.randomUUID().toString().replace("-", "").substring(0, 12).toUpperCase();
dvMachineryType.setMachineryTypeCode(machineryTypeCode);
return toAjax(dvMachineryTypeService.insertDvMachineryType(dvMachineryType));
}
/**
* 修改设备类型
*/
@Log(title = "设备类型", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvMachineryType dvMachineryType)
{
return toAjax(dvMachineryTypeService.updateDvMachineryType(dvMachineryType));
}
/**
* 删除设备类型
*/
@Log(title = "设备类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{machineryTypeIds}")
public R<Void> remove(@PathVariable Long[] machineryTypeIds)
{
for (Long typeId:machineryTypeIds
) {
DvMachinery param = new DvMachinery();
param.setMachineryId(typeId);
List<DvMachinery> machinerys = dvMachineryService.selectDvMachineryList(param);
if(CollUtil.isNotEmpty(machinerys)){
return R.fail("设备类型下已配置了设备,不能删除!");
}
}
return toAjax(dvMachineryTypeService.deleteDvMachineryTypeByMachineryTypeIds(machineryTypeIds));
}
}

View File

@@ -0,0 +1,98 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.excel.ExcelUtil;
import com.gear.mes.dv.domain.DvMaintenRecord;
import com.gear.mes.dv.service.IDvMaintenRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备保养记录Controller
*
* @author yinjinlu
* @date 2024-12-26
*/
@RestController
@RequestMapping("/mes/dv/maintenrecord")
public class DvMaintenRecordController extends BaseController
{
@Autowired
private IDvMaintenRecordService dvMaintenRecordService;
/**
* 查询设备保养记录列表
*/
@GetMapping("/list")
public TableDataInfo list(DvMaintenRecord dvMaintenRecord)
{
startPage();
List<DvMaintenRecord> list = dvMaintenRecordService.selectDvMaintenRecordList(dvMaintenRecord);
return getDataTable(list);
}
/**
* 导出设备保养记录列表
*/
@Log(title = "设备保养记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvMaintenRecord dvMaintenRecord)
{
List<DvMaintenRecord> list = dvMaintenRecordService.selectDvMaintenRecordList(dvMaintenRecord);
ExcelUtil<DvMaintenRecord> util = new ExcelUtil<DvMaintenRecord>(DvMaintenRecord.class);
util.exportExcel(response, list, "设备保养记录数据");
}
/**
* 获取设备保养记录详细信息
*/
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
{
return AjaxResult.success(dvMaintenRecordService.selectDvMaintenRecordByRecordId(recordId));
}
/**
* 新增设备保养记录
*/
@Log(title = "设备保养记录", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvMaintenRecord dvMaintenRecord)
{
return toAjax(dvMaintenRecordService.insertDvMaintenRecord(dvMaintenRecord));
}
/**
* 修改设备保养记录
*/
@Log(title = "设备保养记录", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvMaintenRecord dvMaintenRecord)
{
return toAjax(dvMaintenRecordService.updateDvMaintenRecord(dvMaintenRecord));
}
/**
* 删除设备保养记录
*/
@Log(title = "设备保养记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public R<Void> remove(@PathVariable Long[] recordIds)
{
return toAjax(dvMaintenRecordService.deleteDvMaintenRecordByRecordIds(recordIds));
}
}

View File

@@ -0,0 +1,98 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.excel.ExcelUtil;
import com.gear.mes.dv.domain.DvMaintenRecordLine;
import com.gear.mes.dv.service.IDvMaintenRecordLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备保养记录行Controller
*
* @author yinjinlu
* @date 2024-12-26
*/
@RestController
@RequestMapping("/mes/dv/maintenrecordline")
public class DvMaintenRecordLineController extends BaseController
{
@Autowired
private IDvMaintenRecordLineService dvMaintenRecordLineService;
/**
* 查询设备保养记录行列表
*/
@GetMapping("/list")
public TableDataInfo list(DvMaintenRecordLine dvMaintenRecordLine)
{
startPage();
List<DvMaintenRecordLine> list = dvMaintenRecordLineService.selectDvMaintenRecordLineList(dvMaintenRecordLine);
return getDataTable(list);
}
/**
* 导出设备保养记录行列表
*/
@Log(title = "设备保养记录行", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvMaintenRecordLine dvMaintenRecordLine)
{
List<DvMaintenRecordLine> list = dvMaintenRecordLineService.selectDvMaintenRecordLineList(dvMaintenRecordLine);
ExcelUtil<DvMaintenRecordLine> util = new ExcelUtil<DvMaintenRecordLine>(DvMaintenRecordLine.class);
util.exportExcel(response, list, "设备保养记录行数据");
}
/**
* 获取设备保养记录行详细信息
*/
@GetMapping(value = "/{lineId}")
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
{
return AjaxResult.success(dvMaintenRecordLineService.selectDvMaintenRecordLineByLineId(lineId));
}
/**
* 新增设备保养记录行
*/
@Log(title = "设备保养记录行", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvMaintenRecordLine dvMaintenRecordLine)
{
return toAjax(dvMaintenRecordLineService.insertDvMaintenRecordLine(dvMaintenRecordLine));
}
/**
* 修改设备保养记录行
*/
@Log(title = "设备保养记录行", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvMaintenRecordLine dvMaintenRecordLine)
{
return toAjax(dvMaintenRecordLineService.updateDvMaintenRecordLine(dvMaintenRecordLine));
}
/**
* 删除设备保养记录行
*/
@Log(title = "设备保养记录行", businessType = BusinessType.DELETE)
@DeleteMapping("/{lineIds}")
public R<Void> remove(@PathVariable Long[] lineIds)
{
return toAjax(dvMaintenRecordLineService.deleteDvMaintenRecordLineByLineIds(lineIds));
}
}

View File

@@ -0,0 +1,115 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.excel.ExcelUtil;
import com.gear.mes.dv.domain.DvRepair;
import com.gear.mes.dv.domain.dto.DvRepairDTO;
import com.gear.mes.dv.service.IDvRepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备维修单Controller
*
* @author yinjinlu
* @date 2022-08-06
*/
@RestController
@RequestMapping("/mes/dv/repair")
public class DvRepairController extends BaseController
{
@Autowired
private IDvRepairService dvRepairService;
/**
* 查询设备维修单列表
*/
@GetMapping("/list")
public TableDataInfo list(DvRepair dvRepair)
{
startPage();
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
return getDataTable(list);
}
/**
* 导出设备维修单列表
*/
@Log(title = "设备维修单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvRepair dvRepair)
{
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
ExcelUtil<DvRepair> util = new ExcelUtil<DvRepair>(DvRepair.class);
util.exportExcel(response, list, "设备维修单数据");
}
/**
* 获取设备维修单详细信息
*/
@GetMapping(value = "/{repairId}")
public AjaxResult getInfo(@PathVariable("repairId") Long repairId)
{
return AjaxResult.success(dvRepairService.selectDvRepairByRepairId(repairId));
}
/**
* 新增设备维修单
*/
@Log(title = "设备维修单", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvRepair dvRepair)
{
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
return R.fail("维修单编号已存!");
}
return toAjax(dvRepairService.insertDvRepair(dvRepair));
}
/**
* 修改设备维修单
*/
@Log(title = "设备维修单", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvRepair dvRepair)
{
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
return R.fail("维修单编号已存!");
}
return toAjax(dvRepairService.updateDvRepair(dvRepair));
}
/**
* 删除设备维修单
*/
@Log(title = "设备维修单", businessType = BusinessType.DELETE)
@DeleteMapping("/{repairIds}")
public R<Void> remove(@PathVariable Long[] repairIds)
{
return toAjax(dvRepairService.deleteDvRepairByRepairIds(repairIds));
}
/**
* 根据设备编码查询设备维修单列表
*/
@GetMapping("/getRepairList")
public AjaxResult getRepairList(DvRepairDTO repairDTO) {
return dvRepairService.getRepairList(repairDTO);
}
}

View File

@@ -0,0 +1,98 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.excel.ExcelUtil;
import com.gear.mes.dv.domain.DvRepairLine;
import com.gear.mes.dv.service.IDvRepairLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备维修单行Controller
*
* @author yinjinlu
* @date 2022-08-08
*/
@RestController
@RequestMapping("/mes/dv/repairline")
public class DvRepairLineController extends BaseController
{
@Autowired
private IDvRepairLineService dvRepairLineService;
/**
* 查询设备维修单行列表
*/
@GetMapping("/list")
public TableDataInfo list(DvRepairLine dvRepairLine)
{
startPage();
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
return getDataTable(list);
}
/**
* 导出设备维修单行列表
*/
@Log(title = "设备维修单行", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvRepairLine dvRepairLine)
{
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
ExcelUtil<DvRepairLine> util = new ExcelUtil<DvRepairLine>(DvRepairLine.class);
util.exportExcel(response, list, "设备维修单行数据");
}
/**
* 获取设备维修单行详细信息
*/
@GetMapping(value = "/{lineId}")
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
{
return AjaxResult.success(dvRepairLineService.selectDvRepairLineByLineId(lineId));
}
/**
* 新增设备维修单行
*/
@Log(title = "设备维修单行", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvRepairLine dvRepairLine)
{
return toAjax(dvRepairLineService.insertDvRepairLine(dvRepairLine));
}
/**
* 修改设备维修单行
*/
@Log(title = "设备维修单行", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvRepairLine dvRepairLine)
{
return toAjax(dvRepairLineService.updateDvRepairLine(dvRepairLine));
}
/**
* 删除设备维修单行
*/
@Log(title = "设备维修单行", businessType = BusinessType.DELETE)
@DeleteMapping("/{lineIds}")
public R<Void> remove(@PathVariable Long[] lineIds)
{
return toAjax(dvRepairLineService.deleteDvRepairLineByLineIds(lineIds));
}
}

View File

@@ -0,0 +1,100 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.annotation.RepeatSubmit;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.PageQuery;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.core.validate.AddGroup;
import com.gear.common.core.validate.EditGroup;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.poi.ExcelUtil;
import com.gear.mes.dv.domain.bo.DvSpecialEquipmentBo;
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
import com.gear.mes.dv.service.IDvSpecialEquipmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;
/**
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*
* @author klp
* @date 2025-08-21
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/mes/specialEquipment")
public class DvSpecialEquipmentController extends BaseController {
private final IDvSpecialEquipmentService iDvSpecialEquipmentService;
/**
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
*/
@GetMapping("/list")
public TableDataInfo<DvSpecialEquipmentVo> list(DvSpecialEquipmentBo bo, PageQuery pageQuery) {
return iDvSpecialEquipmentService.queryPageList(bo, pageQuery);
}
/**
* 导出特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
*/
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(DvSpecialEquipmentBo bo, HttpServletResponse response) {
List<DvSpecialEquipmentVo> list = iDvSpecialEquipmentService.queryList(bo);
ExcelUtil.exportExcel(list, "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", DvSpecialEquipmentVo.class, response);
}
/**
* 获取特种设备(包含锅炉、压力管道、电梯等特种设备信息)详细信息
*
* @param equipmentId 主键
*/
@GetMapping("/{equipmentId}")
public R<DvSpecialEquipmentVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long equipmentId) {
return R.ok(iDvSpecialEquipmentService.queryById(equipmentId));
}
/**
* 新增特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody DvSpecialEquipmentBo bo) {
return toAjax(iDvSpecialEquipmentService.insertByBo(bo));
}
/**
* 修改特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DvSpecialEquipmentBo bo) {
return toAjax(iDvSpecialEquipmentService.updateByBo(bo));
}
/**
* 删除特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*
* @param equipmentIds 主键串
*/
@Log(title = "特种设备(包含锅炉、压力管道、电梯等特种设备信息)", businessType = BusinessType.DELETE)
@DeleteMapping("/{equipmentIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] equipmentIds) {
return toAjax(iDvSpecialEquipmentService.deleteWithValidByIds(Arrays.asList(equipmentIds), true));
}
}

View File

@@ -0,0 +1,104 @@
package com.gear.mes.dv.controller;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.excel.ExcelUtil;
import com.gear.mes.dv.domain.DvSubject;
import com.gear.mes.dv.service.IDvSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 设备点检保养项目Controller
*
* @author yinjinlu
* @date 2022-06-16
*/
@RestController
@RequestMapping("/mes/dv/dvsubject")
public class DvSubjectController extends BaseController
{
@Autowired
private IDvSubjectService dvSubjectService;
/**
* 查询设备点检保养项目列表
*/
@GetMapping("/list")
public TableDataInfo list(DvSubject dvSubject)
{
startPage();
List<DvSubject> list = dvSubjectService.selectDvSubjectList(dvSubject);
return getDataTable(list);
}
/**
* 导出设备点检保养项目列表
*/
@Log(title = "设备点检保养项目", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DvSubject dvSubject)
{
List<DvSubject> list = dvSubjectService.selectDvSubjectList(dvSubject);
ExcelUtil<DvSubject> util = new ExcelUtil<DvSubject>(DvSubject.class);
util.exportExcel(response, list, "设备点检保养项目数据");
}
/**
* 获取设备点检保养项目详细信息
*/
@GetMapping(value = "/{subjectId}")
public AjaxResult getInfo(@PathVariable("subjectId") Long subjectId)
{
return AjaxResult.success(dvSubjectService.selectDvSubjectBySubjectId(subjectId));
}
/**
* 新增设备点检保养项目
*/
@Log(title = "设备点检保养项目", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvSubject dvSubject)
{
if(UserConstants.NOT_UNIQUE.equals(dvSubjectService.checkSubjectCodeUnique(dvSubject))){
return R.fail("项目编码已存在!");
}
return toAjax(dvSubjectService.insertDvSubject(dvSubject));
}
/**
* 修改设备点检保养项目
*/
@Log(title = "设备点检保养项目", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvSubject dvSubject)
{
if(UserConstants.NOT_UNIQUE.equals(dvSubjectService.checkSubjectCodeUnique(dvSubject))){
return R.fail("项目编码已存在!");
}
return toAjax(dvSubjectService.updateDvSubject(dvSubject));
}
/**
* 删除设备点检保养项目
*/
@Log(title = "设备点检保养项目", businessType = BusinessType.DELETE)
@DeleteMapping("/{subjectIds}")
public R<Void> remove(@PathVariable Long[] subjectIds)
{
return toAjax(dvSubjectService.deleteDvSubjectBySubjectIds(subjectIds));
}
}

View File

@@ -0,0 +1,59 @@
package com.gear.mes.dv.controller.mobile;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.enums.BusinessType;
import com.gear.mes.dv.domain.DvCheckRecordLine;
import com.gear.mes.dv.service.IDvCheckRecordLineService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author yinjinlu
* @description
* @date 2025/4/30
*/
@RestController
@RequestMapping("/mobile/dv/checkrecordline")
public class DvCheckRecordLineMobController extends BaseController {
@Autowired
private IDvCheckRecordLineService dvCheckRecordLineService;
/**
* 查询设备点检记录行列表
*/
@GetMapping("/list")
public AjaxResult list(DvCheckRecordLine dvCheckRecordLine)
{
List<DvCheckRecordLine> list = dvCheckRecordLineService.selectDvCheckRecordLineList(dvCheckRecordLine);
return AjaxResult.success(list);
}
/**
* 获取设备点检记录行详细信息
*/
@GetMapping(value = "/{lineId}")
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
{
return AjaxResult.success(dvCheckRecordLineService.selectDvCheckRecordLineByLineId(lineId));
}
/**
* 修改设备点检记录行
*/
@Log(title = "设备点检记录行", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvCheckRecordLine dvCheckRecordLine)
{
return toAjax(dvCheckRecordLineService.updateDvCheckRecordLine(dvCheckRecordLine));
}
}

View File

@@ -0,0 +1,184 @@
package com.gear.mes.dv.controller.mobile;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvCheckPlan;
import com.gear.mes.dv.domain.DvCheckRecord;
import com.gear.mes.dv.domain.DvCheckRecordLine;
import com.gear.mes.dv.domain.DvCheckSubject;
import com.gear.mes.dv.service.IDvCheckPlanService;
import com.gear.mes.dv.service.IDvCheckRecordLineService;
import com.gear.mes.dv.service.IDvCheckRecordService;
import com.gear.mes.dv.service.IDvCheckSubjectService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author yinjinlu
* @description
* @date 2025/4/30
*/
@RestController
@RequestMapping("/mobile/dv/checkrecord")
public class DvCheckRecordMobController extends BaseController {
@Autowired
private IDvCheckRecordService dvCheckRecordService;
@Autowired
private IDvCheckSubjectService dvCheckSubjectService;
@Autowired
private IDvCheckRecordLineService dvCheckRecordLineService;
@Autowired
private IDvCheckPlanService dvCheckPlanService;
/**
* 查询设备点检记录列表
*/
@GetMapping("/list")
public TableDataInfo list(DvCheckRecord dvCheckRecord)
{
startPage();
List<DvCheckRecord> list = dvCheckRecordService.selectDvCheckRecordList(dvCheckRecord);
return getDataTable(list);
}
/**
* 获取设备点检记录详细信息
*/
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
{
return AjaxResult.success(dvCheckRecordService.selectDvCheckRecordByRecordId(recordId));
}
/**
* 新增设备点检记录
*/
@Log(title = "设备点检记录", businessType = BusinessType.INSERT)
@Transactional
@PostMapping
public AjaxResult add(@RequestBody DvCheckRecord dvCheckRecord)
{
dvCheckRecordService.insertDvCheckRecord(dvCheckRecord);
//查找生效的点检方案,生成对应的行信息
DvCheckPlan plan = dvCheckPlanService.selectDvCheckPlanByMachineryCodeAndType(dvCheckRecord.getMachineryCode(),UserConstants.DV_PLAN_TYPE_CHECK);
if(StringUtils.isNotNull(plan)){
dvCheckRecord.setPlanId(plan.getPlanId());
dvCheckRecord.setPlanCode(plan.getPlanCode());
dvCheckRecord.setPlanName(plan.getPlanName());
dvCheckRecord.setPlanType(plan.getPlanType());
dvCheckRecordService.updateDvCheckRecord(dvCheckRecord);
//根据选择的点检计划自动生成对应的行信息
DvCheckSubject param = new DvCheckSubject();
param.setPlanId(dvCheckRecord.getPlanId());
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
if(!CollectionUtils.isEmpty(subjectList)){
for(DvCheckSubject subject : subjectList){
DvCheckRecordLine line = new DvCheckRecordLine();
line.setRecordId(dvCheckRecord.getRecordId());
line.setSubjectId(subject.getSubjectId());
line.setSubjectCode(subject.getSubjectCode());
line.setSubjectName(subject.getSubjectName());
line.setSubjectType(subject.getSubjectType());
line.setSubjectContent(subject.getSubjectContent());
line.setSubjectStandard(subject.getSubjectStandard());
line.setCheckStatus(UserConstants.DV_CHECK_STATUS_NOTCHECK);
dvCheckRecordLineService.insertDvCheckRecordLine(line);
}
}
return AjaxResult.success(dvCheckRecord);
}else{
return AjaxResult.error("当前设备未找到有效的点检方案,请先添加点检方案");
}
}
/**
* 修改设备点检记录
*/
@Log(title = "设备点检记录", businessType = BusinessType.UPDATE)
@Transactional
@PutMapping
public R<Void> edit(@RequestBody DvCheckRecord dvCheckRecord)
{
if(UserConstants.ORDER_STATUS_FINISHED.equals(dvCheckRecord.getStatus())){
DvCheckRecordLine param = new DvCheckRecordLine();
param.setRecordId(dvCheckRecord.getRecordId());
List<DvCheckRecordLine> lineList = dvCheckRecordLineService.selectDvCheckRecordLineList(param);
if(CollectionUtils.isEmpty(lineList)){
return R.fail("请添加设备点检项目结果信息");
}
}
//如果设备不同则重新生成对应的点检行信息
DvCheckRecord oldRecord = dvCheckRecordService.selectDvCheckRecordByRecordId(dvCheckRecord.getRecordId());
if(!oldRecord.getMachineryCode().equals(dvCheckRecord.getMachineryCode())){
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(dvCheckRecord.getRecordId());
DvCheckPlan plan = dvCheckPlanService.selectDvCheckPlanByMachineryCodeAndType(dvCheckRecord.getMachineryCode(),UserConstants.DV_PLAN_TYPE_CHECK);
if(StringUtils.isNotNull(plan)){
dvCheckRecord.setPlanId(plan.getPlanId());
dvCheckRecord.setPlanCode(plan.getPlanCode());
dvCheckRecord.setPlanName(plan.getPlanName());
dvCheckRecord.setPlanType(plan.getPlanType());
dvCheckRecordService.updateDvCheckRecord(dvCheckRecord);
//根据选择的点检计划自动生成对应的行信息
DvCheckSubject param = new DvCheckSubject();
param.setPlanId(dvCheckRecord.getPlanId());
List<DvCheckSubject> subjectList = dvCheckSubjectService.selectDvCheckSubjectList(param);
if(!CollectionUtils.isEmpty(subjectList)){
for(DvCheckSubject subject : subjectList){
DvCheckRecordLine line = new DvCheckRecordLine();
line.setRecordId(dvCheckRecord.getRecordId());
line.setSubjectId(subject.getSubjectId());
line.setSubjectCode(subject.getSubjectCode());
line.setSubjectName(subject.getSubjectName());
line.setSubjectType(subject.getSubjectType());
line.setSubjectContent(subject.getSubjectContent());
line.setSubjectStandard(subject.getSubjectStandard());
line.setCheckStatus(UserConstants.DV_CHECK_STATUS_NOTCHECK);
dvCheckRecordLineService.insertDvCheckRecordLine(line);
}
}
}else{
return R.fail("当前设备未找到有效的点检方案,请先添加点检方案");
}
}
return toAjax(dvCheckRecordService.updateDvCheckRecord(dvCheckRecord));
}
/**
* 删除设备点检记录
*/
@Log(title = "设备点检记录", businessType = BusinessType.DELETE)
@Transactional
@DeleteMapping("/{recordIds}")
public R<Void> remove(@PathVariable Long[] recordIds)
{
for(Long recordId : recordIds){
dvCheckRecordLineService.deleteDvCheckRecordLineByRecordId(recordId);
}
return toAjax(dvCheckRecordService.deleteDvCheckRecordByRecordIds(recordIds));
}
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.controller.mobile;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.mes.dv.domain.DvMachinery;
import com.gear.mes.dv.service.IDvMachineryService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* @author yinjinlu
* @description
* @date 2025/4/30
*/
@RestController
@RequestMapping("/mobile/dv/machinery")
public class DvMachineryMobController extends BaseController {
@Autowired
private IDvMachineryService dvMachineryService;
/**
* 查询设备列表
*/
@GetMapping("/list")
public TableDataInfo list(DvMachinery dvMachinery)
{
startPage();
List<DvMachinery> list = dvMachineryService.selectDvMachineryList(dvMachinery);
return getDataTable(list);
}
/**
* 修改设备
*/
@Log(title = "设备", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DvMachinery dvMachinery)
{
if(UserConstants.NOT_UNIQUE.equals(dvMachineryService.checkRecptCodeUnique(dvMachinery))){
return AjaxResult.error("编号已存在!");
}
return dvMachineryService.updateDvMachinery(dvMachinery);
}
/**
* 获取设备详细信息
*/
@GetMapping(value = "/{machineryId}")
public AjaxResult getInfo(@PathVariable("machineryId") Long machineryId)
{
return AjaxResult.success(dvMachineryService.selectDvMachineryByMachineryId(machineryId));
}
}

View File

@@ -0,0 +1,59 @@
package com.gear.mes.dv.controller.mobile;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.enums.BusinessType;
import com.gear.mes.dv.domain.DvMaintenRecordLine;
import com.gear.mes.dv.service.IDvMaintenRecordLineService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 设备保养记录行Controller
*
* @author yinjinlu
* @date 2024-12-26
*/
@RestController
@RequestMapping("/mobile/dv/maintenrecordline")
public class DvMaintenRecordLineMobController extends BaseController {
@Autowired
private IDvMaintenRecordLineService dvMaintenRecordLineService;
/**
* 查询设备保养记录行列表
*/
@GetMapping("/list")
public AjaxResult list(DvMaintenRecordLine dvMaintenRecordLine) {
List<DvMaintenRecordLine> list = dvMaintenRecordLineService.selectDvMaintenRecordLineList(dvMaintenRecordLine);
return AjaxResult.success(list);
}
/**
* 获取设备保养记录行详细信息
*/
@GetMapping(value = "/{lineId}")
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
{
return AjaxResult.success(dvMaintenRecordLineService.selectDvMaintenRecordLineByLineId(lineId));
}
/**
* 修改设备保养记录行
*/
@Log(title = "设备保养记录行", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvMaintenRecordLine dvMaintenRecordLine)
{
return toAjax(dvMaintenRecordLineService.updateDvMaintenRecordLine(dvMaintenRecordLine));
}
}

View File

@@ -0,0 +1,83 @@
package com.gear.mes.dv.controller.mobile;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.mes.dv.domain.DvMaintenRecord;
import com.gear.mes.dv.service.IDvMaintenRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 设备保养记录Controller
*
* @author yinjinlu
* @date 2025-05-06
*/
@RestController
@RequestMapping("/mobile/dv/maintenrecord")
public class DvMaintenRecordMobController extends BaseController {
@Autowired
private IDvMaintenRecordService dvMaintenRecordService;
/**
* 查询设备保养记录列表
*/
@GetMapping("/list")
public TableDataInfo list(DvMaintenRecord dvMaintenRecord)
{
startPage();
List<DvMaintenRecord> list = dvMaintenRecordService.selectDvMaintenRecordList(dvMaintenRecord);
return getDataTable(list);
}
/**
* 获取设备保养记录详细信息
*/
@GetMapping(value = "/{recordId}")
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
{
return AjaxResult.success(dvMaintenRecordService.selectDvMaintenRecordByRecordId(recordId));
}
/**
* 新增设备保养记录
*/
@Log(title = "设备保养记录", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvMaintenRecord dvMaintenRecord)
{
return toAjax(dvMaintenRecordService.insertDvMaintenRecord(dvMaintenRecord));
}
/**
* 修改设备保养记录
*/
@Log(title = "设备保养记录", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvMaintenRecord dvMaintenRecord)
{
return toAjax(dvMaintenRecordService.updateDvMaintenRecord(dvMaintenRecord));
}
/**
* 删除设备保养记录
*/
@Log(title = "设备保养记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public R<Void> remove(@PathVariable Long[] recordIds)
{
return toAjax(dvMaintenRecordService.deleteDvMaintenRecordByRecordIds(recordIds));
}
}

View File

@@ -0,0 +1,81 @@
package com.gear.mes.dv.controller.mobile;
import com.gear.common.annotation.Log;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.enums.BusinessType;
import com.gear.mes.dv.domain.DvRepairLine;
import com.gear.mes.dv.service.IDvRepairLineService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
/**
* 设备维修单行Controller
*
* @author yinjinlu
* @date 2022-08-08
*/
@RestController
@RequestMapping("/mobile/dv/repairline")
public class DvRepairLineMobController extends BaseController {
@Autowired
private IDvRepairLineService dvRepairLineService;
/**
* 查询设备维修单行列表
*/
@GetMapping("/list")
public AjaxResult list(DvRepairLine dvRepairLine)
{
List<DvRepairLine> list = dvRepairLineService.selectDvRepairLineList(dvRepairLine);
return AjaxResult.success(list);
}
/**
* 获取设备维修单行详细信息
*/
@GetMapping(value = "/{lineId}")
public AjaxResult getInfo(@PathVariable("lineId") Long lineId)
{
return AjaxResult.success(dvRepairLineService.selectDvRepairLineByLineId(lineId));
}
/**
* 新增设备维修单行
*/
@Log(title = "设备维修单行", businessType = BusinessType.INSERT)
@PostMapping
public R<Void> add(@RequestBody DvRepairLine dvRepairLine)
{
return toAjax(dvRepairLineService.insertDvRepairLine(dvRepairLine));
}
/**
* 修改设备维修单行
*/
@Log(title = "设备维修单行", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvRepairLine dvRepairLine)
{
return toAjax(dvRepairLineService.updateDvRepairLine(dvRepairLine));
}
/**
* 删除设备维修单行
*/
@Log(title = "设备维修单行", businessType = BusinessType.DELETE)
@DeleteMapping("/{lineIds}")
public R<Void> remove(@PathVariable Long[] lineIds)
{
return toAjax(dvRepairLineService.deleteDvRepairLineByLineIds(lineIds));
}
}

View File

@@ -0,0 +1,103 @@
package com.gear.mes.dv.controller.mobile;
import com.gear.common.annotation.Log;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.controller.BaseController;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.core.domain.R;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.enums.BusinessType;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvRepair;
import com.gear.mes.dv.service.IDvRepairService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import java.util.UUID;
/**
* 设备维修单Controller
*
* @author yinjinlu
* @date 2025-05-06
*/
@RestController
@RequestMapping("/mobile/dv/repair")
public class DvRepairMobController extends BaseController {
@Autowired
private IDvRepairService dvRepairService;
/**
* 查询设备维修单列表
*/
@GetMapping("/list")
public TableDataInfo list(DvRepair dvRepair)
{
startPage();
List<DvRepair> list = dvRepairService.selectDvRepairList(dvRepair);
return getDataTable(list);
}
/**
* 获取设备维修单详细信息
*/
@GetMapping(value = "/{repairId}")
public AjaxResult getInfo(@PathVariable("repairId") Long repairId)
{
return AjaxResult.success(dvRepairService.selectDvRepairByRepairId(repairId));
}
/**
* 新增设备维修单
*/
@Log(title = "设备维修单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DvRepair dvRepair)
{
if(StringUtils.isNotNull(dvRepair.getRepairCode())){
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
return AjaxResult.error("维修单编号已存!");
}
} else{
dvRepair.setRepairCode("REPAIR-" + UUID.randomUUID().toString().replace("-", "").substring(0, 12).toUpperCase());
}
//根据sourceDocType和sourceDocId 生成对应的维修单项目
dvRepairService.insertDvRepair(dvRepair);
return AjaxResult.success(dvRepair);
}
/**
* 修改设备维修单
*/
@Log(title = "设备维修单", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@RequestBody DvRepair dvRepair)
{
if(UserConstants.NOT_UNIQUE.equals(dvRepairService.checkCodeUnique(dvRepair))){
return R.fail("维修单编号已存!");
}
return toAjax(dvRepairService.updateDvRepair(dvRepair));
}
/**
* 删除设备维修单
*/
@Log(title = "设备维修单", businessType = BusinessType.DELETE)
@DeleteMapping("/{repairIds}")
public R<Void> remove(@PathVariable Long[] repairIds)
{
return toAjax(dvRepairService.deleteDvRepairByRepairIds(repairIds));
}
}

View File

@@ -0,0 +1,61 @@
package com.gear.mes.dv.domain;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 点检设备对象 dv_check_machinery
*
* @author yinjinlu
* @date 2022-06-17
*/
@Data
public class DvCheckMachinery extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 流水号 */
private Long recordId;
/** 计划ID */
@Excel(name = "计划ID")
private Long planId;
/** 设备ID */
@Excel(name = "设备ID")
private Long machineryId;
/** 设备编码 */
@Excel(name = "设备编码")
private String machineryCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String machineryName;
/** 品牌 */
@Excel(name = "品牌")
private String machineryBrand;
/** 规格型号 */
@Excel(name = "规格型号")
private String machinerySpec;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,70 @@
package com.gear.mes.dv.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 设备点检计划头对象 dv_check_plan
*
* @author yinjinlu
* @date 2022-06-16
*/
@Data
public class DvCheckPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 计划ID */
private Long planId;
/** 计划编码 */
@Excel(name = "计划编码")
private String planCode;
/** 计划名称 */
@Excel(name = "计划名称")
private String planName;
private String planType;
/** 开始日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "开始日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date startDate;
/** 结束日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "结束日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date endDate;
/** 频率 */
@Excel(name = "频率")
private String cycleType;
/** 次数 */
@Excel(name = "次数")
private Long cycleCount;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,90 @@
package com.gear.mes.dv.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 设备点检记录对象 dv_check_record
*
* @author yinjinlu
* @date 2024-12-26
*/
@Data
public class DvCheckRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 计划ID */
private Long recordId;
/** 计划ID */
@Excel(name = "计划ID")
private Long planId;
/** 计划编码 */
@Excel(name = "计划编码")
private String planCode;
/** 计划名称 */
@Excel(name = "计划名称")
private String planName;
/** 计划类型 */
@Excel(name = "计划类型")
private String planType;
/** 设备ID */
@Excel(name = "设备ID")
private Long machineryId;
/** 设备编码 */
@Excel(name = "设备编码")
private String machineryCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String machineryName;
/** 品牌 */
@Excel(name = "品牌")
private String machineryBrand;
/** 规格型号 */
@Excel(name = "规格型号")
private String machinerySpec;
/** 点检时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@Excel(name = "点检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTime;
private Long userId;
private String userName;
private String nickName;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,70 @@
package com.gear.mes.dv.domain;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 设备点检记录行对象 dv_check_record_line
*
* @author yinjinlu
* @date 2024-12-26
*/
@Data
public class DvCheckRecordLine extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 计划ID */
private Long lineId;
/** 计划ID */
@Excel(name = "计划ID")
private Long recordId;
/** 项目ID */
@Excel(name = "项目ID")
private Long subjectId;
/** 项目编码 */
@Excel(name = "项目编码")
private String subjectCode;
/** 项目名称 */
@Excel(name = "项目名称")
private String subjectName;
/** 项目类型 */
@Excel(name = "项目类型")
private String subjectType;
/** 项目内容 */
@Excel(name = "项目内容")
private String subjectContent;
/** 标准 */
@Excel(name = "标准")
private String subjectStandard;
/** 点检结果 */
@Excel(name = "点检结果")
private String checkStatus;
/** 异常描述 */
@Excel(name = "异常描述")
private String checkResult;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
}

View File

@@ -0,0 +1,63 @@
package com.gear.mes.dv.domain;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 点检项目对象 dv_check_subject
*
* @author yinjinlu
* @date 2022-06-18
*/
@Data
public class DvCheckSubject extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 流水号 */
private Long recordId;
/** 计划ID */
@Excel(name = "计划ID")
private Long planId;
/** 设备ID */
@Excel(name = "设备ID")
private Long subjectId;
/** 项目编码 */
@Excel(name = "项目编码")
private String subjectCode;
/** 项目名称 */
@Excel(name = "项目名称")
private String subjectName;
/** 项目类型 */
@Excel(name = "项目类型")
private String subjectType;
/** 项目内容 */
@Excel(name = "项目内容")
private String subjectContent;
/** 标准 */
@Excel(name = "标准")
private String subjectStandard;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,91 @@
package com.gear.mes.dv.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 设备对象 dv_machinery
*
* @author yinjinlu
* @date 2022-05-08
*/
@Data
public class DvMachinery extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 设备类型ID */
private Long machineryId;
/** 设备类型编码 */
@Excel(name = "设备编码")
private String machineryCode;
/** 设备类型名称 */
@Excel(name = "设备名称")
private String machineryName;
/** 品牌 */
@Excel(name = "品牌")
private String machineryBrand;
/** 规格型号 */
@Excel(name = "规格型号")
private String machinerySpec;
/** 设备类型ID */
@Excel(name = "设备类型ID")
private Long machineryTypeId;
/** 设备类型编码 */
@Excel(name = "设备类型编码")
private String machineryTypeCode;
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String machineryTypeName;
/** 所属车间ID */
@Excel(name = "所属车间ID")
private Long workshopId;
/** 所属车间编码 */
@Excel(name = "所属车间编码")
private String workshopCode;
/** 所属车间名称 */
@Excel(name = "所属车间名称")
private String workshopName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@Excel(name = "最近保养时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lastMaintenTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss" , timezone = "GMT+8")
@Excel(name = "最近点检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lastCheckTime;
/** 设备状态 */
@Excel(name = "设备状态")
private String status;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,55 @@
package com.gear.mes.dv.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.TreeEntity;
import lombok.Data;
/**
* 设备类型对象 dv_machinery_type
*
* @author yinjinlu
* @date 2022-05-08
*/
@Data
public class DvMachineryType extends TreeEntity
{
private static final long serialVersionUID = 1L;
/** 设备类型ID */
private Long machineryTypeId;
/** 设备类型编码 */
@Excel(name = "设备类型编码")
private String machineryTypeCode;
/** 设备类型名称 */
@Excel(name = "设备类型名称")
private String machineryTypeName;
/** 父类型ID */
@Excel(name = "父类型ID")
private Long parentTypeId;
/** 是否启用 */
@Excel(name = "是否启用")
private String enableFlag;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
/** 祖级列表 */
@TableField(exist = false)
private String ancestors;
}

View File

@@ -0,0 +1,96 @@
package com.gear.mes.dv.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 设备保养记录对象 dv_mainten_record
*
* @author yinjinlu
* @date 2024-12-26
*/
@Data
public class DvMaintenRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 计划ID */
private Long recordId;
/** 计划ID */
@Excel(name = "计划ID")
private Long planId;
/** 计划编码 */
@Excel(name = "计划编码")
private String planCode;
/** 计划名称 */
@Excel(name = "计划名称")
private String planName;
/** 计划类型 */
@Excel(name = "计划类型")
private String planType;
/** 设备ID */
@Excel(name = "设备ID")
private Long machineryId;
/** 设备编码 */
@Excel(name = "设备编码")
private String machineryCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String machineryName;
/** 品牌 */
@Excel(name = "品牌")
private String machineryBrand;
/** 规格型号 */
@Excel(name = "规格型号")
private String machinerySpec;
/** 保养时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "保养时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date maintenTime;
/** 用户ID */
@Excel(name = "用户ID")
private Long userId;
/** 用户名 */
@Excel(name = "用户名")
private String userName;
/** 昵称 */
@Excel(name = "昵称")
private String nickName;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,69 @@
package com.gear.mes.dv.domain;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 设备保养记录行对象 dv_mainten_record_line
*
* @author yinjinlu
* @date 2024-12-26
*/
@Data
public class DvMaintenRecordLine extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 计划ID */
private Long lineId;
/** 计划ID */
@Excel(name = "计划ID")
private Long recordId;
/** 项目ID */
@Excel(name = "项目ID")
private Long subjectId;
/** 项目编码 */
@Excel(name = "项目编码")
private String subjectCode;
/** 项目名称 */
@Excel(name = "项目名称")
private String subjectName;
/** 项目类型 */
@Excel(name = "项目类型")
private String subjectType;
/** 项目内容 */
@Excel(name = "项目内容")
private String subjectContent;
/** 标准 */
@Excel(name = "标准")
private String subjectStandard;
/** 保养结果 */
@Excel(name = "保养结果")
private String maintenStatus;
/** 异常描述 */
@Excel(name = "异常描述")
private String maintenResult;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
}

View File

@@ -0,0 +1,116 @@
package com.gear.mes.dv.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 设备维修单对象 dv_repair
*
* @author yinjinlu
* @date 2022-08-06
*/
@Data
public class DvRepair extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 维修单ID */
private Long repairId;
/** 维修单编号 */
@Excel(name = "维修单编号")
private String repairCode;
/** 维修单名称 */
@Excel(name = "维修单名称")
private String repairName;
/** 设备ID */
@Excel(name = "设备ID")
private Long machineryId;
/** 设备编码 */
@Excel(name = "设备编码")
private String machineryCode;
/** 设备名称 */
@Excel(name = "设备名称")
private String machineryName;
/** 品牌 */
@Excel(name = "品牌")
private String machineryBrand;
/** 规格型号 */
@Excel(name = "规格型号")
private String machinerySpec;
/** 设备类型ID */
@Excel(name = "设备类型ID")
private Long machineryTypeId;
/** 报修日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "报修日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date requireDate;
/** 维修完成日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "维修完成日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date finishDate;
/** 验收日期 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "验收日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date confirmDate;
/** 维修结果 */
@Excel(name = "维修结果")
private String repairResult;
private Long acceptedId;
private String acceptedName;
/** 维修人员 */
@Excel(name = "维修人员")
private String acceptedBy;
private Long confirmId;
private String confirmName;
/** 验收人员 */
@Excel(name = "验收人员")
private String confirmBy;
private String sourceDocType;
private Long sourceDocId;
private String sourceDocCode;
/** 单据状态 */
@Excel(name = "单据状态")
private String status;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,76 @@
package com.gear.mes.dv.domain;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 设备维修单行对象 dv_repair_line
*
* @author yinjinlu
* @date 2022-08-08
*/
@Data
public class DvRepairLine extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 行ID */
private Long lineId;
/** 维修单ID */
@Excel(name = "维修单ID")
private Long repairId;
/** 项目ID */
@Excel(name = "项目ID")
private Long subjectId;
/** 项目编码 */
@Excel(name = "项目编码")
private String subjectCode;
/** 项目名称 */
@Excel(name = "项目名称")
private String subjectName;
/** 项目类型 */
@Excel(name = "项目类型")
private String subjectType;
/** 项目内容 */
@Excel(name = "项目内容")
private String subjectContent;
/** 标准 */
@Excel(name = "标准")
private String subjectStandard;
/** 故障描述 */
@Excel(name = "故障描述")
private String malfunction;
/** 故障描述资源 */
@Excel(name = "故障描述资源")
private String malfunctionUrl;
/** 维修情况 */
@Excel(name = "维修情况")
private String repairDes;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,93 @@
package com.gear.mes.dv.domain;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)对象 dv_special_equipment
*
* @author klp
* @date 2025-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("dv_special_equipment")
public class DvSpecialEquipment extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 设备ID
*/
@TableId(value = "equipment_id")
private Long equipmentId;
/**
* 设备编码
*/
private String equipmentCode;
/**
* 设备名称(如:锅炉、压力容器、压力管道、电梯、起重机械等)
*/
private String equipmentName;
/**
* 规格型号
*/
private String specificationModel;
/**
* 制造单位
*/
private String manufacturer;
/**
* 制造日期
*/
private Date productionDate;
/**
* 安装日期
*/
private Date installationDate;
/**
* 投入使用日期
*/
private Date useStartDate;
/**
* 特种设备注册编号
*/
private String registrationNo;
/**
* 安全负责人
*/
private String safetyManager;
/**
* 附件路径(多个附件用逗号分隔)
*/
private String attachment;
/**
* 检验周期(月)
*/
private Long inspectionCycle;
/**
* 上次检验时间
*/
private Date lastInspectionTime;
/**
* 下次检验时间
*/
private Date nextInspectionTime;
/**
* 当前状态(在用、停用、报废等)
*/
private String currentStatus;
/**
* 备注
*/
private String remark;
/**
* 删除标志0=正常1=已删除)
*/
@TableLogic
private Integer delFlag;
}

View File

@@ -0,0 +1,59 @@
package com.gear.mes.dv.domain;
import com.gear.common.annotation.Excel;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 设备点检保养项目对象 dv_subject
*
* @author yinjinlu
* @date 2022-06-16
*/
@Data
public class DvSubject extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 项目ID */
private Long subjectId;
/** 项目编码 */
@Excel(name = "项目编码")
private String subjectCode;
/** 项目名称 */
@Excel(name = "项目名称")
private String subjectName;
/** 项目类型 */
@Excel(name = "项目类型")
private String subjectType;
/** 项目内容 */
@Excel(name = "项目内容")
private String subjectContent;
/** 标准 */
@Excel(name = "标准")
private String subjectStandard;
/** 是否启用 */
@Excel(name = "是否启用")
private String enableFlag;
/** 预留字段1 */
private String attr1;
/** 预留字段2 */
private String attr2;
/** 预留字段3 */
private Long attr3;
/** 预留字段4 */
private Long attr4;
/** 备注 */
private String remark;
}

View File

@@ -0,0 +1,113 @@
package com.gear.mes.dv.domain.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gear.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
/**
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)业务对象 dv_special_equipment
*
* @author klp
* @date 2025-08-21
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class DvSpecialEquipmentBo extends BaseEntity {
/**
* 设备ID
*/
private Long equipmentId;
/**
* 设备编码
*/
private String equipmentCode;
/**
* 设备名称(如:锅炉、压力容器、压力管道、电梯、起重机械等)
*/
private String equipmentName;
/**
* 规格型号
*/
private String specificationModel;
/**
* 制造单位
*/
private String manufacturer;
/**
* 制造日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date productionDate;
/**
* 安装日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date installationDate;
/**
* 投入使用日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date useStartDate;
/**
* 特种设备注册编号
*/
private String registrationNo;
/**
* 安全负责人
*/
private String safetyManager;
/**
* 附件路径(多个附件用逗号分隔)
*/
private String attachment;
/**
* 检验周期(月)
*/
private Long inspectionCycle;
/**
* 上次检验时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastInspectionTime;
/**
* 下次检验时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date nextInspectionTime;
/**
* 当前状态(在用、停用、报废等)
*/
private String currentStatus;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,12 @@
package com.gear.mes.dv.domain.dto;
import lombok.Data;
@Data
public class DvCheckPlanDTO {
private String planType;
private String machineryCode;
}

View File

@@ -0,0 +1,10 @@
package com.gear.mes.dv.domain.dto;
import lombok.Data;
@Data
public class DvRepairDTO {
private String machineryCode;
}

View File

@@ -0,0 +1,131 @@
package com.gear.mes.dv.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.gear.common.annotation.ExcelDictFormat;
import com.gear.common.convert.ExcelDictConvert;
import lombok.Data;
import java.util.Date;
/**
* 特种设备(包含锅炉、压力管道、电梯等特种设备信息)视图对象 dv_special_equipment
*
* @author klp
* @date 2025-08-21
*/
@Data
@ExcelIgnoreUnannotated
public class DvSpecialEquipmentVo {
private static final long serialVersionUID = 1L;
/**
* 设备ID
*/
@ExcelProperty(value = "设备ID")
private Long equipmentId;
/**
* 设备编码
*/
@ExcelProperty(value = "设备编码")
private String equipmentCode;
/**
* 设备名称(如:锅炉、压力容器、压力管道、电梯、起重机械等)
*/
@ExcelProperty(value = "设备名称", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "如=:锅炉、压力容器、压力管道、电梯、起重机械等")
private String equipmentName;
/**
* 规格型号
*/
@ExcelProperty(value = "规格型号")
private String specificationModel;
/**
* 制造单位
*/
@ExcelProperty(value = "制造单位")
private String manufacturer;
/**
* 制造日期
*/
@ExcelProperty(value = "制造日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date productionDate;
/**
* 安装日期
*/
@ExcelProperty(value = "安装日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date installationDate;
/**
* 投入使用日期
*/
@ExcelProperty(value = "投入使用日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date useStartDate;
/**
* 特种设备注册编号
*/
@ExcelProperty(value = "特种设备注册编号")
private String registrationNo;
/**
* 安全负责人
*/
@ExcelProperty(value = "安全负责人")
private String safetyManager;
/**
* 附件路径(多个附件用逗号分隔)
*/
@ExcelProperty(value = "附件路径", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "多=个附件用逗号分隔")
private String attachment;
/**
* 检验周期(月)
*/
@ExcelProperty(value = "检验周期", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "月=")
private Long inspectionCycle;
/**
* 上次检验时间
*/
@ExcelProperty(value = "上次检验时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date lastInspectionTime;
/**
* 下次检验时间
*/
@ExcelProperty(value = "下次检验时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date nextInspectionTime;
/**
* 当前状态(在用、停用、报废等)
*/
@ExcelProperty(value = "当前状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "在=用、停用、报废等")
private String currentStatus;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@@ -0,0 +1,79 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvCheckMachinery;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 点检设备Mapper接口
*
* @author yinjinlu
* @date 2022-06-17
*/
public interface DvCheckMachineryMapper
{
/**
* 查询点检设备
*
* @param recordId 点检设备主键
* @return 点检设备
*/
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId);
/**
* 查询点检设备列表
*
* @param dvCheckMachinery 点检设备
* @return 点检设备集合
*/
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery);
public DvCheckMachinery checkMachineryUnique(DvCheckMachinery dvCheckMachinery);
/**
* 新增点检设备
*
* @param dvCheckMachinery 点检设备
* @return 结果
*/
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
/**
* 修改点检设备
*
* @param dvCheckMachinery 点检设备
* @return 结果
*/
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
/**
* 删除点检设备
*
* @param recordId 点检设备主键
* @return 结果
*/
public int deleteDvCheckMachineryByRecordId(Long recordId);
/**
* 批量删除点检设备
*
* @param recordIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds);
/**
* 根据计划头ID删除对应的设备列表
* @param planId
* @return
*/
public int deleteByPlanId(Long planId);
/**
* 根据设备编码获取相关计划id
* @param machineryCode
* @return
*/
List<Long> getPlanId(@Param("machineryCode") String machineryCode);
}

View File

@@ -0,0 +1,69 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvCheckPlan;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 设备点检计划头Mapper接口
*
* @author yinjinlu
* @date 2022-06-16
*/
public interface DvCheckPlanMapper
{
/**
* 查询设备点检计划头
*
* @param planId 设备点检计划头主键
* @return 设备点检计划头
*/
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId);
/**
* 查询设备点检计划头列表
*
* @param dvCheckPlan 设备点检计划头
* @return 设备点检计划头集合
*/
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan);
public DvCheckPlan checkPlanCodeUnique(DvCheckPlan dvCheckPlan);
/**
* 新增设备点检计划头
*
* @param dvCheckPlan 设备点检计划头
* @return 结果
*/
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan);
/**
* 修改设备点检计划头
*
* @param dvCheckPlan 设备点检计划头
* @return 结果
*/
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan);
/**
* 删除设备点检计划头
*
* @param planId 设备点检计划头主键
* @return 结果
*/
public int deleteDvCheckPlanByPlanId(Long planId);
/**
* 批量删除设备点检计划头
*
* @param planIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvCheckPlanByPlanIds(Long[] planIds);
DvCheckPlan selectDvCheckPlanByMachineryCodeAndType(@Param("machineryCode") String machineryCode, @Param("planType") String planType);
List<DvCheckPlan> getByIds(@Param("planIds") List<Long> planIds,@Param("planType") String planType);
}

View File

@@ -0,0 +1,70 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvCheckRecordLine;
import java.util.List;
/**
* 设备点检记录行Mapper接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface DvCheckRecordLineMapper
{
/**
* 查询设备点检记录行
*
* @param lineId 设备点检记录行主键
* @return 设备点检记录行
*/
public DvCheckRecordLine selectDvCheckRecordLineByLineId(Long lineId);
/**
* 查询设备点检记录行列表
*
* @param dvCheckRecordLine 设备点检记录行
* @return 设备点检记录行集合
*/
public List<DvCheckRecordLine> selectDvCheckRecordLineList(DvCheckRecordLine dvCheckRecordLine);
/**
* 新增设备点检记录行
*
* @param dvCheckRecordLine 设备点检记录行
* @return 结果
*/
public int insertDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
/**
* 修改设备点检记录行
*
* @param dvCheckRecordLine 设备点检记录行
* @return 结果
*/
public int updateDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
/**
* 删除设备点检记录行
*
* @param lineId 设备点检记录行主键
* @return 结果
*/
public int deleteDvCheckRecordLineByLineId(Long lineId);
/**
* 批量删除设备点检记录行
*
* @param lineIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvCheckRecordLineByLineIds(Long[] lineIds);
/**
* 根据记录ID删除设备点检记录行信息
*
* @param recordId 记录ID
* @return 结果
*/
public int deleteDvCheckRecordLineByRecordId(Long recordId);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvCheckRecord;
import java.util.List;
/**
* 设备点检记录Mapper接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface DvCheckRecordMapper
{
/**
* 查询设备点检记录
*
* @param recordId 设备点检记录主键
* @return 设备点检记录
*/
public DvCheckRecord selectDvCheckRecordByRecordId(Long recordId);
/**
* 查询设备点检记录列表
*
* @param dvCheckRecord 设备点检记录
* @return 设备点检记录集合
*/
public List<DvCheckRecord> selectDvCheckRecordList(DvCheckRecord dvCheckRecord);
/**
* 新增设备点检记录
*
* @param dvCheckRecord 设备点检记录
* @return 结果
*/
public int insertDvCheckRecord(DvCheckRecord dvCheckRecord);
/**
* 修改设备点检记录
*
* @param dvCheckRecord 设备点检记录
* @return 结果
*/
public int updateDvCheckRecord(DvCheckRecord dvCheckRecord);
/**
* 删除设备点检记录
*
* @param recordId 设备点检记录主键
* @return 结果
*/
public int deleteDvCheckRecordByRecordId(Long recordId);
/**
* 批量删除设备点检记录
*
* @param recordIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvCheckRecordByRecordIds(Long[] recordIds);
}

View File

@@ -0,0 +1,72 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvCheckSubject;
import java.util.List;
/**
* 点检项目Mapper接口
*
* @author yinjinlu
* @date 2022-06-18
*/
public interface DvCheckSubjectMapper
{
/**
* 查询点检项目
*
* @param recordId 点检项目主键
* @return 点检项目
*/
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
/**
* 查询点检项目列表
*
* @param dvCheckSubject 点检项目
* @return 点检项目集合
*/
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
public DvCheckSubject checkSubjectUnique(DvCheckSubject dvCheckSubject);
/**
* 新增点检项目
*
* @param dvCheckSubject 点检项目
* @return 结果
*/
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
/**
* 修改点检项目
*
* @param dvCheckSubject 点检项目
* @return 结果
*/
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
/**
* 删除点检项目
*
* @param recordId 点检项目主键
* @return 结果
*/
public int deleteDvCheckSubjectByRecordId(Long recordId);
/**
* 批量删除点检项目
*
* @param recordIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
/**
* 根据计划ID删除对应的计划项目
* @param planId
* @return
*/
public int deleteByPlanId(Long planId);
}

View File

@@ -0,0 +1,72 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvMachinery;
import java.util.List;
/**
* 设备Mapper接口
*
* @author yinjinlu
* @date 2022-05-08
*/
public interface DvMachineryMapper
{
/**
* 查询设备
*
* @param machineryId 设备主键
* @return 设备
*/
public DvMachinery selectDvMachineryByMachineryId(Long machineryId);
/**
* 依据设备编码查询设备
*
* @param machineryCode 设备编码
* @return 设备
*/
public List<DvMachinery> selectByMachineryCode(String machineryCode);
/**
* 查询设备列表
*
* @param dvMachinery 设备
* @return 设备集合
*/
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery);
/**
* 新增设备
*
* @param dvMachinery 设备
* @return 结果
*/
public int insertDvMachinery(DvMachinery dvMachinery);
/**
* 修改设备
*
* @param dvMachinery 设备
* @return 结果
*/
public int updateDvMachinery(DvMachinery dvMachinery);
/**
* 删除设备
*
* @param machineryId 设备主键
* @return 结果
*/
public int deleteDvMachineryByMachineryId(Long machineryId);
/**
* 批量删除设备
*
* @param machineryIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvMachineryByMachineryIds(Long[] machineryIds);
DvMachinery checkRecptCodeUnique(DvMachinery dvMachinery);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvMachineryType;
import java.util.List;
/**
* 设备类型Mapper接口
*
* @author yinjinlu
* @date 2022-05-08
*/
public interface DvMachineryTypeMapper
{
/**
* 查询设备类型
*
* @param machineryTypeId 设备类型主键
* @return 设备类型
*/
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
/**
* 查询设备类型列表
*
* @param dvMachineryType 设备类型
* @return 设备类型集合
*/
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType);
/**
* 新增设备类型
*
* @param dvMachineryType 设备类型
* @return 结果
*/
public int insertDvMachineryType(DvMachineryType dvMachineryType);
/**
* 修改设备类型
*
* @param dvMachineryType 设备类型
* @return 结果
*/
public int updateDvMachineryType(DvMachineryType dvMachineryType);
/**
* 删除设备类型
*
* @param machineryTypeId 设备类型主键
* @return 结果
*/
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
/**
* 批量删除设备类型
*
* @param machineryTypeIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvMaintenRecordLine;
import java.util.List;
/**
* 设备保养记录行Mapper接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface DvMaintenRecordLineMapper
{
/**
* 查询设备保养记录行
*
* @param lineId 设备保养记录行主键
* @return 设备保养记录行
*/
public DvMaintenRecordLine selectDvMaintenRecordLineByLineId(Long lineId);
/**
* 查询设备保养记录行列表
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 设备保养记录行集合
*/
public List<DvMaintenRecordLine> selectDvMaintenRecordLineList(DvMaintenRecordLine dvMaintenRecordLine);
/**
* 新增设备保养记录行
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 结果
*/
public int insertDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
/**
* 修改设备保养记录行
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 结果
*/
public int updateDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
/**
* 删除设备保养记录行
*
* @param lineId 设备保养记录行主键
* @return 结果
*/
public int deleteDvMaintenRecordLineByLineId(Long lineId);
/**
* 批量删除设备保养记录行
*
* @param lineIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvMaintenRecordLineByLineIds(Long[] lineIds);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvMaintenRecord;
import java.util.List;
/**
* 设备保养记录Mapper接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface DvMaintenRecordMapper
{
/**
* 查询设备保养记录
*
* @param recordId 设备保养记录主键
* @return 设备保养记录
*/
public DvMaintenRecord selectDvMaintenRecordByRecordId(Long recordId);
/**
* 查询设备保养记录列表
*
* @param dvMaintenRecord 设备保养记录
* @return 设备保养记录集合
*/
public List<DvMaintenRecord> selectDvMaintenRecordList(DvMaintenRecord dvMaintenRecord);
/**
* 新增设备保养记录
*
* @param dvMaintenRecord 设备保养记录
* @return 结果
*/
public int insertDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
/**
* 修改设备保养记录
*
* @param dvMaintenRecord 设备保养记录
* @return 结果
*/
public int updateDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
/**
* 删除设备保养记录
*
* @param recordId 设备保养记录主键
* @return 结果
*/
public int deleteDvMaintenRecordByRecordId(Long recordId);
/**
* 批量删除设备保养记录
*
* @param recordIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvMaintenRecordByRecordIds(Long[] recordIds);
}

View File

@@ -0,0 +1,64 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvRepairLine;
import java.util.List;
/**
* 设备维修单行Mapper接口
*
* @author yinjinlu
* @date 2022-08-08
*/
public interface DvRepairLineMapper
{
/**
* 查询设备维修单行
*
* @param lineId 设备维修单行主键
* @return 设备维修单行
*/
public DvRepairLine selectDvRepairLineByLineId(Long lineId);
/**
* 查询设备维修单行列表
*
* @param dvRepairLine 设备维修单行
* @return 设备维修单行集合
*/
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine);
/**
* 新增设备维修单行
*
* @param dvRepairLine 设备维修单行
* @return 结果
*/
public int insertDvRepairLine(DvRepairLine dvRepairLine);
/**
* 修改设备维修单行
*
* @param dvRepairLine 设备维修单行
* @return 结果
*/
public int updateDvRepairLine(DvRepairLine dvRepairLine);
/**
* 删除设备维修单行
*
* @param lineId 设备维修单行主键
* @return 结果
*/
public int deleteDvRepairLineByLineId(Long lineId);
/**
* 批量删除设备维修单行
*
* @param lineIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvRepairLineByLineIds(Long[] lineIds);
public int deleteByRepairId(Long repairId);
}

View File

@@ -0,0 +1,74 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvRepair;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 设备维修单Mapper接口
*
* @author yinjinlu
* @date 2022-08-06
*/
public interface DvRepairMapper
{
/**
* 查询设备维修单
*
* @param repairId 设备维修单主键
* @return 设备维修单
*/
public DvRepair selectDvRepairByRepairId(Long repairId);
/**
* 查询设备维修单列表
*
* @param dvRepair 设备维修单
* @return 设备维修单集合
*/
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
public DvRepair checkCodeUnique(DvRepair dvRepair);
/**
* 新增设备维修单
*
* @param dvRepair 设备维修单
* @return 结果
*/
public int insertDvRepair(DvRepair dvRepair);
/**
* 修改设备维修单
*
* @param dvRepair 设备维修单
* @return 结果
*/
public int updateDvRepair(DvRepair dvRepair);
/**
* 删除设备维修单
*
* @param repairId 设备维修单主键
* @return 结果
*/
public int deleteDvRepairByRepairId(Long repairId);
/**
* 批量删除设备维修单
*
* @param repairIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvRepairByRepairIds(Long[] repairIds);
/**
* 根据设备编码查询设备维修单列表
*
* @param machineryCode
* @return
*/
List<DvRepair> getRepairList(@Param("machineryCode") String machineryCode);
}

View File

@@ -0,0 +1,15 @@
package com.gear.mes.dv.mapper;
import com.gear.common.core.mapper.BaseMapperPlus;
import com.gear.mes.dv.domain.DvSpecialEquipment;
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
/**
* 特种设备包含锅炉、压力管道、电梯等特种设备信息Mapper接口
*
* @author klp
* @date 2025-08-21
*/
public interface DvSpecialEquipmentMapper extends BaseMapperPlus<DvSpecialEquipmentMapper, DvSpecialEquipment, DvSpecialEquipmentVo> {
}

View File

@@ -0,0 +1,65 @@
package com.gear.mes.dv.mapper;
import com.gear.mes.dv.domain.DvSubject;
import java.util.List;
/**
* 设备点检保养项目Mapper接口
*
* @author yinjinlu
* @date 2022-06-16
*/
public interface DvSubjectMapper
{
/**
* 查询设备点检保养项目
*
* @param subjectId 设备点检保养项目主键
* @return 设备点检保养项目
*/
public DvSubject selectDvSubjectBySubjectId(Long subjectId);
/**
* 查询设备点检保养项目列表
*
* @param dvSubject 设备点检保养项目
* @return 设备点检保养项目集合
*/
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject);
public DvSubject checkSubjectCodeUnique(DvSubject dvSubject);
/**
* 新增设备点检保养项目
*
* @param dvSubject 设备点检保养项目
* @return 结果
*/
public int insertDvSubject(DvSubject dvSubject);
/**
* 修改设备点检保养项目
*
* @param dvSubject 设备点检保养项目
* @return 结果
*/
public int updateDvSubject(DvSubject dvSubject);
/**
* 删除设备点检保养项目
*
* @param subjectId 设备点检保养项目主键
* @return 结果
*/
public int deleteDvSubjectBySubjectId(Long subjectId);
/**
* 批量删除设备点检保养项目
*
* @param subjectIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteDvSubjectBySubjectIds(Long[] subjectIds);
}

View File

@@ -0,0 +1,78 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvCheckMachinery;
import java.util.List;
/**
* 点检设备Service接口
*
* @author yinjinlu
* @date 2022-06-17
*/
public interface IDvCheckMachineryService
{
/**
* 查询点检设备
*
* @param recordId 点检设备主键
* @return 点检设备
*/
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId);
/**
* 查询点检设备列表
*
* @param dvCheckMachinery 点检设备
* @return 点检设备集合
*/
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery);
public String checkMachineryUnique(DvCheckMachinery dvCheckMachinery);
/**
* 新增点检设备
*
* @param dvCheckMachinery 点检设备
* @return 结果
*/
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
/**
* 修改点检设备
*
* @param dvCheckMachinery 点检设备
* @return 结果
*/
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery);
/**
* 批量删除点检设备
*
* @param recordIds 需要删除的点检设备主键集合
* @return 结果
*/
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds);
/**
* 删除点检设备信息
*
* @param recordId 点检设备主键
* @return 结果
*/
public int deleteDvCheckMachineryByRecordId(Long recordId);
/**
* 根据计划头ID删除对应的设备列表
* @param planId
* @return
*/
public int deleteByPlanId(Long planId);
/**
* 根据设备编码获取相关计划id
* @param machineryCode
* @return
*/
List<Long> getPlanId(String machineryCode);
}

View File

@@ -0,0 +1,80 @@
package com.gear.mes.dv.service;
import com.gear.common.core.domain.AjaxResult;
import com.gear.mes.dv.domain.DvCheckPlan;
import com.gear.mes.dv.domain.dto.DvCheckPlanDTO;
import java.util.List;
/**
* 设备点检计划头Service接口
*
* @author yinjinlu
* @date 2022-06-16
*/
public interface IDvCheckPlanService
{
/**
* 查询设备点检计划头
*
* @param planId 设备点检计划头主键
* @return 设备点检计划头
*/
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId);
/**
* 查询设备点检计划头列表
*
* @param dvCheckPlan 设备点检计划头
* @return 设备点检计划头集合
*/
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan);
/**
* 检查计划编码是否唯一
* @param dvCheckPlan
* @return
*/
public String checkPlanCodeUnique(DvCheckPlan dvCheckPlan);
/**
* 新增设备点检计划头
*
* @param dvCheckPlan 设备点检计划头
* @return 结果
*/
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan);
/**
* 修改设备点检计划头
*
* @param dvCheckPlan 设备点检计划头
* @return 结果
*/
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan);
/**
* 批量删除设备点检计划头
*
* @param planIds 需要删除的设备点检计划头主键集合
* @return 结果
*/
public int deleteDvCheckPlanByPlanIds(Long[] planIds);
/**
* 删除设备点检计划头信息
*
* @param planId 设备点检计划头主键
* @return 结果
*/
public int deleteDvCheckPlanByPlanId(Long planId);
/**
* 根据设备编码和计划类型查询设备点检计划头列表
* @return
*/
AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO);
public DvCheckPlan selectDvCheckPlanByMachineryCodeAndType(String machineryCode, String planType);
}

View File

@@ -0,0 +1,70 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvCheckRecordLine;
import java.util.List;
/**
* 设备点检记录行Service接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface IDvCheckRecordLineService
{
/**
* 查询设备点检记录行
*
* @param lineId 设备点检记录行主键
* @return 设备点检记录行
*/
public DvCheckRecordLine selectDvCheckRecordLineByLineId(Long lineId);
/**
* 查询设备点检记录行列表
*
* @param dvCheckRecordLine 设备点检记录行
* @return 设备点检记录行集合
*/
public List<DvCheckRecordLine> selectDvCheckRecordLineList(DvCheckRecordLine dvCheckRecordLine);
/**
* 新增设备点检记录行
*
* @param dvCheckRecordLine 设备点检记录行
* @return 结果
*/
public int insertDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
/**
* 修改设备点检记录行
*
* @param dvCheckRecordLine 设备点检记录行
* @return 结果
*/
public int updateDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine);
/**
* 批量删除设备点检记录行
*
* @param lineIds 需要删除的设备点检记录行主键集合
* @return 结果
*/
public int deleteDvCheckRecordLineByLineIds(Long[] lineIds);
/**
* 删除设备点检记录行信息
*
* @param lineId 设备点检记录行主键
* @return 结果
*/
public int deleteDvCheckRecordLineByLineId(Long lineId);
/**
* 根据记录ID删除设备点检记录行信息
*
* @param recordId 记录ID
* @return 结果
*/
public int deleteDvCheckRecordLineByRecordId(Long recordId);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvCheckRecord;
import java.util.List;
/**
* 设备点检记录Service接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface IDvCheckRecordService
{
/**
* 查询设备点检记录
*
* @param recordId 设备点检记录主键
* @return 设备点检记录
*/
public DvCheckRecord selectDvCheckRecordByRecordId(Long recordId);
/**
* 查询设备点检记录列表
*
* @param dvCheckRecord 设备点检记录
* @return 设备点检记录集合
*/
public List<DvCheckRecord> selectDvCheckRecordList(DvCheckRecord dvCheckRecord);
/**
* 新增设备点检记录
*
* @param dvCheckRecord 设备点检记录
* @return 结果
*/
public int insertDvCheckRecord(DvCheckRecord dvCheckRecord);
/**
* 修改设备点检记录
*
* @param dvCheckRecord 设备点检记录
* @return 结果
*/
public int updateDvCheckRecord(DvCheckRecord dvCheckRecord);
/**
* 批量删除设备点检记录
*
* @param recordIds 需要删除的设备点检记录主键集合
* @return 结果
*/
public int deleteDvCheckRecordByRecordIds(Long[] recordIds);
/**
* 删除设备点检记录信息
*
* @param recordId 设备点检记录主键
* @return 结果
*/
public int deleteDvCheckRecordByRecordId(Long recordId);
}

View File

@@ -0,0 +1,77 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvCheckSubject;
import java.util.List;
/**
* 点检项目Service接口
*
* @author yinjinlu
* @date 2022-06-18
*/
public interface IDvCheckSubjectService
{
/**
* 查询点检项目
*
* @param recordId 点检项目主键
* @return 点检项目
*/
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId);
/**
* 查询点检项目列表
*
* @param dvCheckSubject 点检项目
* @return 点检项目集合
*/
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject);
/**
* 检查当前计划下,点检项目是否唯一
* @param dvCheckSubject
* @return
*/
public String checkSubjectUnique(DvCheckSubject dvCheckSubject);
/**
* 新增点检项目
*
* @param dvCheckSubject 点检项目
* @return 结果
*/
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject);
/**
* 修改点检项目
*
* @param dvCheckSubject 点检项目
* @return 结果
*/
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject);
/**
* 批量删除点检项目
*
* @param recordIds 需要删除的点检项目主键集合
* @return 结果
*/
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds);
/**
* 删除点检项目信息
*
* @param recordId 点检项目主键
* @return 结果
*/
public int deleteDvCheckSubjectByRecordId(Long recordId);
/**
* 根据计划ID删除对应的计划项目
* @param planId
* @return
*/
public int deleteByPlanId(Long planId);
}

View File

@@ -0,0 +1,80 @@
package com.gear.mes.dv.service;
import com.gear.common.core.domain.AjaxResult;
import com.gear.mes.dv.domain.DvMachinery;
import java.util.List;
/**
* 设备Service接口
*
* @author yinjinlu
* @date 2022-05-08
*/
public interface IDvMachineryService
{
/**
* 查询设备
*
* @param machineryId 设备主键
* @return 设备
*/
public DvMachinery selectDvMachineryByMachineryId(Long machineryId);
/**
* 查询设备列表
*
* @param dvMachinery 设备
* @return 设备集合
*/
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery);
/**
* 新增设备
*
* @param dvMachinery 设备
* @return 结果
*/
public AjaxResult insertDvMachinery(DvMachinery dvMachinery);
/**
* 修改设备
*
* @param dvMachinery 设备
* @return 结果
*/
public AjaxResult updateDvMachinery(DvMachinery dvMachinery);
/**
* 批量删除设备
*
* @param machineryIds 需要删除的设备主键集合
* @return 结果
*/
public int deleteDvMachineryByMachineryIds(Long[] machineryIds);
/**
* 删除设备信息
*
* @param machineryId 设备主键
* @return 结果
*/
public int deleteDvMachineryByMachineryId(Long machineryId);
/**
* 依据上传的文件,批量导入或更新设备信息
*
* @param machineryList 设备信息列表
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
* @param operName 操作用户
* @return 结果
*/
public String importMachinery(List<DvMachinery> machineryList, Boolean isUpdateSupport, String operName);
/**
* 查询编码是否唯一
* @param dvMachinery
* @return
*/
String checkRecptCodeUnique(DvMachinery dvMachinery);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvMachineryType;
import java.util.List;
/**
* 设备类型Service接口
*
* @author yinjinlu
* @date 2022-05-08
*/
public interface IDvMachineryTypeService
{
/**
* 查询设备类型
*
* @param machineryTypeId 设备类型主键
* @return 设备类型
*/
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
/**
* 查询设备类型列表
*
* @param dvMachineryType 设备类型
* @return 设备类型集合
*/
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType);
/**
* 新增设备类型
*
* @param dvMachineryType 设备类型
* @return 结果
*/
public int insertDvMachineryType(DvMachineryType dvMachineryType);
/**
* 修改设备类型
*
* @param dvMachineryType 设备类型
* @return 结果
*/
public int updateDvMachineryType(DvMachineryType dvMachineryType);
/**
* 批量删除设备类型
*
* @param machineryTypeIds 需要删除的设备类型主键集合
* @return 结果
*/
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds);
/**
* 删除设备类型信息
*
* @param machineryTypeId 设备类型主键
* @return 结果
*/
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvMaintenRecordLine;
import java.util.List;
/**
* 设备保养记录行Service接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface IDvMaintenRecordLineService
{
/**
* 查询设备保养记录行
*
* @param lineId 设备保养记录行主键
* @return 设备保养记录行
*/
public DvMaintenRecordLine selectDvMaintenRecordLineByLineId(Long lineId);
/**
* 查询设备保养记录行列表
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 设备保养记录行集合
*/
public List<DvMaintenRecordLine> selectDvMaintenRecordLineList(DvMaintenRecordLine dvMaintenRecordLine);
/**
* 新增设备保养记录行
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 结果
*/
public int insertDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
/**
* 修改设备保养记录行
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 结果
*/
public int updateDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine);
/**
* 批量删除设备保养记录行
*
* @param lineIds 需要删除的设备保养记录行主键集合
* @return 结果
*/
public int deleteDvMaintenRecordLineByLineIds(Long[] lineIds);
/**
* 删除设备保养记录行信息
*
* @param lineId 设备保养记录行主键
* @return 结果
*/
public int deleteDvMaintenRecordLineByLineId(Long lineId);
}

View File

@@ -0,0 +1,62 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvMaintenRecord;
import java.util.List;
/**
* 设备保养记录Service接口
*
* @author yinjinlu
* @date 2024-12-26
*/
public interface IDvMaintenRecordService
{
/**
* 查询设备保养记录
*
* @param recordId 设备保养记录主键
* @return 设备保养记录
*/
public DvMaintenRecord selectDvMaintenRecordByRecordId(Long recordId);
/**
* 查询设备保养记录列表
*
* @param dvMaintenRecord 设备保养记录
* @return 设备保养记录集合
*/
public List<DvMaintenRecord> selectDvMaintenRecordList(DvMaintenRecord dvMaintenRecord);
/**
* 新增设备保养记录
*
* @param dvMaintenRecord 设备保养记录
* @return 结果
*/
public int insertDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
/**
* 修改设备保养记录
*
* @param dvMaintenRecord 设备保养记录
* @return 结果
*/
public int updateDvMaintenRecord(DvMaintenRecord dvMaintenRecord);
/**
* 批量删除设备保养记录
*
* @param recordIds 需要删除的设备保养记录主键集合
* @return 结果
*/
public int deleteDvMaintenRecordByRecordIds(Long[] recordIds);
/**
* 删除设备保养记录信息
*
* @param recordId 设备保养记录主键
* @return 结果
*/
public int deleteDvMaintenRecordByRecordId(Long recordId);
}

View File

@@ -0,0 +1,69 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvRepairLine;
import java.util.List;
/**
* 设备维修单行Service接口
*
* @author yinjinlu
* @date 2022-08-08
*/
public interface IDvRepairLineService
{
/**
* 查询设备维修单行
*
* @param lineId 设备维修单行主键
* @return 设备维修单行
*/
public DvRepairLine selectDvRepairLineByLineId(Long lineId);
/**
* 查询设备维修单行列表
*
* @param dvRepairLine 设备维修单行
* @return 设备维修单行集合
*/
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine);
/**
* 新增设备维修单行
*
* @param dvRepairLine 设备维修单行
* @return 结果
*/
public int insertDvRepairLine(DvRepairLine dvRepairLine);
/**
* 修改设备维修单行
*
* @param dvRepairLine 设备维修单行
* @return 结果
*/
public int updateDvRepairLine(DvRepairLine dvRepairLine);
/**
* 批量删除设备维修单行
*
* @param lineIds 需要删除的设备维修单行主键集合
* @return 结果
*/
public int deleteDvRepairLineByLineIds(Long[] lineIds);
/**
* 删除设备维修单行信息
*
* @param lineId 设备维修单行主键
* @return 结果
*/
public int deleteDvRepairLineByLineId(Long lineId);
/**
* 根据维修单头删除所有行信息
* @param repairId
* @return
*/
public int deleteByRepairId(Long repairId);
}

View File

@@ -0,0 +1,78 @@
package com.gear.mes.dv.service;
import com.gear.common.core.domain.AjaxResult;
import com.gear.mes.dv.domain.DvRepair;
import com.gear.mes.dv.domain.dto.DvRepairDTO;
import java.util.List;
/**
* 设备维修单Service接口
*
* @author yinjinlu
* @date 2022-08-06
*/
public interface IDvRepairService
{
/**
* 查询设备维修单
*
* @param repairId 设备维修单主键
* @return 设备维修单
*/
public DvRepair selectDvRepairByRepairId(Long repairId);
/**
* 查询设备维修单列表
*
* @param dvRepair 设备维修单
* @return 设备维修单集合
*/
public List<DvRepair> selectDvRepairList(DvRepair dvRepair);
/**
* 检测维修单编号是否唯一
* @param dvRepair
* @return
*/
public String checkCodeUnique(DvRepair dvRepair);
/**
* 新增设备维修单
*
* @param dvRepair 设备维修单
* @return 结果
*/
public int insertDvRepair(DvRepair dvRepair);
/**
* 修改设备维修单
*
* @param dvRepair 设备维修单
* @return 结果
*/
public int updateDvRepair(DvRepair dvRepair);
/**
* 批量删除设备维修单
*
* @param repairIds 需要删除的设备维修单主键集合
* @return 结果
*/
public int deleteDvRepairByRepairIds(Long[] repairIds);
/**
* 删除设备维修单信息
*
* @param repairId 设备维修单主键
* @return 结果
*/
public int deleteDvRepairByRepairId(Long repairId);
/**
* 根据设备编码查询设备维修单列表
* @param repairDTO
* @return
*/
AjaxResult getRepairList(DvRepairDTO repairDTO);
}

View File

@@ -0,0 +1,48 @@
package com.gear.mes.dv.service;
import com.gear.common.core.domain.PageQuery;
import com.gear.common.core.page.TableDataInfo;
import com.gear.mes.dv.domain.bo.DvSpecialEquipmentBo;
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
import java.util.Collection;
import java.util.List;
/**
* 特种设备包含锅炉、压力管道、电梯等特种设备信息Service接口
*
* @author klp
* @date 2025-08-21
*/
public interface IDvSpecialEquipmentService {
/**
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
DvSpecialEquipmentVo queryById(Long equipmentId);
/**
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
*/
TableDataInfo<DvSpecialEquipmentVo> queryPageList(DvSpecialEquipmentBo bo, PageQuery pageQuery);
/**
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
*/
List<DvSpecialEquipmentVo> queryList(DvSpecialEquipmentBo bo);
/**
* 新增特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
Boolean insertByBo(DvSpecialEquipmentBo bo);
/**
* 修改特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
Boolean updateByBo(DvSpecialEquipmentBo bo);
/**
* 校验并批量删除特种设备(包含锅炉、压力管道、电梯等特种设备信息)信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@@ -0,0 +1,69 @@
package com.gear.mes.dv.service;
import com.gear.mes.dv.domain.DvSubject;
import java.util.List;
/**
* 设备点检保养项目Service接口
*
* @author yinjinlu
* @date 2022-06-16
*/
public interface IDvSubjectService
{
/**
* 查询设备点检保养项目
*
* @param subjectId 设备点检保养项目主键
* @return 设备点检保养项目
*/
public DvSubject selectDvSubjectBySubjectId(Long subjectId);
/**
* 查询设备点检保养项目列表
*
* @param dvSubject 设备点检保养项目
* @return 设备点检保养项目集合
*/
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject);
/**
* 检查项目编码是否重复
* @param dvSubject
* @return
*/
public String checkSubjectCodeUnique(DvSubject dvSubject);
/**
* 新增设备点检保养项目
*
* @param dvSubject 设备点检保养项目
* @return 结果
*/
public int insertDvSubject(DvSubject dvSubject);
/**
* 修改设备点检保养项目
*
* @param dvSubject 设备点检保养项目
* @return 结果
*/
public int updateDvSubject(DvSubject dvSubject);
/**
* 批量删除设备点检保养项目
*
* @param subjectIds 需要删除的设备点检保养项目主键集合
* @return 结果
*/
public int deleteDvSubjectBySubjectIds(Long[] subjectIds);
/**
* 删除设备点检保养项目信息
*
* @param subjectId 设备点检保养项目主键
* @return 结果
*/
public int deleteDvSubjectBySubjectId(Long subjectId);
}

View File

@@ -0,0 +1,119 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.constant.UserConstants;
import com.gear.common.utils.DateUtils;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvCheckMachinery;
import com.gear.mes.dv.mapper.DvCheckMachineryMapper;
import com.gear.mes.dv.service.IDvCheckMachineryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 点检设备Service业务层处理
*
* @author yinjinlu
* @date 2022-06-17
*/
@Service
public class DvCheckMachineryServiceImpl implements IDvCheckMachineryService
{
@Autowired
private DvCheckMachineryMapper dvCheckMachineryMapper;
/**
* 查询点检设备
*
* @param recordId 点检设备主键
* @return 点检设备
*/
@Override
public DvCheckMachinery selectDvCheckMachineryByRecordId(Long recordId)
{
return dvCheckMachineryMapper.selectDvCheckMachineryByRecordId(recordId);
}
/**
* 查询点检设备列表
*
* @param dvCheckMachinery 点检设备
* @return 点检设备
*/
@Override
public List<DvCheckMachinery> selectDvCheckMachineryList(DvCheckMachinery dvCheckMachinery)
{
return dvCheckMachineryMapper.selectDvCheckMachineryList(dvCheckMachinery);
}
@Override
public String checkMachineryUnique(DvCheckMachinery dvCheckMachinery) {
DvCheckMachinery machinery = dvCheckMachineryMapper.checkMachineryUnique(dvCheckMachinery);
Long recordId = dvCheckMachinery.getRecordId()==null?-1L:dvCheckMachinery.getRecordId();
if(StringUtils.isNotNull(machinery) && machinery.getRecordId().longValue() != recordId.longValue()){
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 新增点检设备
*
* @param dvCheckMachinery 点检设备
* @return 结果
*/
@Override
public int insertDvCheckMachinery(DvCheckMachinery dvCheckMachinery)
{
dvCheckMachinery.setCreateTime(DateUtils.getNowDate());
return dvCheckMachineryMapper.insertDvCheckMachinery(dvCheckMachinery);
}
/**
* 修改点检设备
*
* @param dvCheckMachinery 点检设备
* @return 结果
*/
@Override
public int updateDvCheckMachinery(DvCheckMachinery dvCheckMachinery)
{
dvCheckMachinery.setUpdateTime(DateUtils.getNowDate());
return dvCheckMachineryMapper.updateDvCheckMachinery(dvCheckMachinery);
}
/**
* 批量删除点检设备
*
* @param recordIds 需要删除的点检设备主键
* @return 结果
*/
@Override
public int deleteDvCheckMachineryByRecordIds(Long[] recordIds)
{
return dvCheckMachineryMapper.deleteDvCheckMachineryByRecordIds(recordIds);
}
/**
* 删除点检设备信息
*
* @param recordId 点检设备主键
* @return 结果
*/
@Override
public int deleteDvCheckMachineryByRecordId(Long recordId)
{
return dvCheckMachineryMapper.deleteDvCheckMachineryByRecordId(recordId);
}
@Override
public int deleteByPlanId(Long planId) {
return dvCheckMachineryMapper.deleteByPlanId(planId);
}
@Override
public List<Long> getPlanId(String machineryCode) {
return dvCheckMachineryMapper.getPlanId(machineryCode);
}
}

View File

@@ -0,0 +1,138 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.utils.DateUtils;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvCheckPlan;
import com.gear.mes.dv.domain.dto.DvCheckPlanDTO;
import com.gear.mes.dv.mapper.DvCheckPlanMapper;
import com.gear.mes.dv.service.IDvCheckMachineryService;
import com.gear.mes.dv.service.IDvCheckPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备点检计划头Service业务层处理
*
* @author yinjinlu
* @date 2022-06-16
*/
@Service
public class DvCheckPlanServiceImpl implements IDvCheckPlanService
{
@Autowired
private DvCheckPlanMapper dvCheckPlanMapper;
@Autowired
private IDvCheckMachineryService dvCheckMachineryService;
/**
* 查询设备点检计划头
*
* @param planId 设备点检计划头主键
* @return 设备点检计划头
*/
@Override
public DvCheckPlan selectDvCheckPlanByPlanId(Long planId)
{
return dvCheckPlanMapper.selectDvCheckPlanByPlanId(planId);
}
/**
* 查询设备点检计划头列表
*
* @param dvCheckPlan 设备点检计划头
* @return 设备点检计划头
*/
@Override
public List<DvCheckPlan> selectDvCheckPlanList(DvCheckPlan dvCheckPlan)
{
return dvCheckPlanMapper.selectDvCheckPlanList(dvCheckPlan);
}
@Override
public String checkPlanCodeUnique(DvCheckPlan dvCheckPlan) {
DvCheckPlan plan = dvCheckPlanMapper.checkPlanCodeUnique(dvCheckPlan);
Long planId = dvCheckPlan.getPlanId()==null?-1L:dvCheckPlan.getPlanId();
if(StringUtils.isNotNull(plan) && plan.getPlanId().longValue()!=planId.longValue()){
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 新增设备点检计划头
*
* @param dvCheckPlan 设备点检计划头
* @return 结果
*/
@Override
public int insertDvCheckPlan(DvCheckPlan dvCheckPlan)
{
dvCheckPlan.setCreateTime(DateUtils.getNowDate());
return dvCheckPlanMapper.insertDvCheckPlan(dvCheckPlan);
}
/**
* 修改设备点检计划头
*
* @param dvCheckPlan 设备点检计划头
* @return 结果
*/
@Override
public int updateDvCheckPlan(DvCheckPlan dvCheckPlan)
{
dvCheckPlan.setUpdateTime(DateUtils.getNowDate());
return dvCheckPlanMapper.updateDvCheckPlan(dvCheckPlan);
}
/**
* 批量删除设备点检计划头
*
* @param planIds 需要删除的设备点检计划头主键
* @return 结果
*/
@Override
public int deleteDvCheckPlanByPlanIds(Long[] planIds)
{
return dvCheckPlanMapper.deleteDvCheckPlanByPlanIds(planIds);
}
/**
* 删除设备点检计划头信息
*
* @param planId 设备点检计划头主键
* @return 结果
*/
@Override
public int deleteDvCheckPlanByPlanId(Long planId)
{
return dvCheckPlanMapper.deleteDvCheckPlanByPlanId(planId);
}
/**
* 根据设备编码和计划类型查询设备点检计划头列表
* @return
*/
@Override
public AjaxResult getCheckPlan(DvCheckPlanDTO checkPlanDTO) {
// 根据设备编码获取相关计划id
List<Long> planIds = dvCheckMachineryService.getPlanId(checkPlanDTO.getMachineryCode());
if (planIds != null && planIds.size() > 0) {
// 根据设备编码和计划类型获取相关设备点检计划头列表
List<DvCheckPlan> list = dvCheckPlanMapper.getByIds(planIds, checkPlanDTO.getPlanType());
return AjaxResult.success(list);
}
return AjaxResult.success();
}
@Override
public DvCheckPlan selectDvCheckPlanByMachineryCodeAndType(String machineryCode, String planType) {
return dvCheckPlanMapper.selectDvCheckPlanByMachineryCodeAndType(machineryCode, planType);
}
}

View File

@@ -0,0 +1,102 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.utils.DateUtils;
import com.gear.mes.dv.domain.DvCheckRecordLine;
import com.gear.mes.dv.mapper.DvCheckRecordLineMapper;
import com.gear.mes.dv.service.IDvCheckRecordLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备点检记录行Service业务层处理
*
* @author yinjinlu
* @date 2024-12-26
*/
@Service
public class DvCheckRecordLineServiceImpl implements IDvCheckRecordLineService
{
@Autowired
private DvCheckRecordLineMapper dvCheckRecordLineMapper;
/**
* 查询设备点检记录行
*
* @param lineId 设备点检记录行主键
* @return 设备点检记录行
*/
@Override
public DvCheckRecordLine selectDvCheckRecordLineByLineId(Long lineId)
{
return dvCheckRecordLineMapper.selectDvCheckRecordLineByLineId(lineId);
}
/**
* 查询设备点检记录行列表
*
* @param dvCheckRecordLine 设备点检记录行
* @return 设备点检记录行
*/
@Override
public List<DvCheckRecordLine> selectDvCheckRecordLineList(DvCheckRecordLine dvCheckRecordLine)
{
return dvCheckRecordLineMapper.selectDvCheckRecordLineList(dvCheckRecordLine);
}
/**
* 新增设备点检记录行
*
* @param dvCheckRecordLine 设备点检记录行
* @return 结果
*/
@Override
public int insertDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine)
{
dvCheckRecordLine.setCreateTime(DateUtils.getNowDate());
return dvCheckRecordLineMapper.insertDvCheckRecordLine(dvCheckRecordLine);
}
/**
* 修改设备点检记录行
*
* @param dvCheckRecordLine 设备点检记录行
* @return 结果
*/
@Override
public int updateDvCheckRecordLine(DvCheckRecordLine dvCheckRecordLine)
{
dvCheckRecordLine.setUpdateTime(DateUtils.getNowDate());
return dvCheckRecordLineMapper.updateDvCheckRecordLine(dvCheckRecordLine);
}
/**
* 批量删除设备点检记录行
*
* @param lineIds 需要删除的设备点检记录行主键
* @return 结果
*/
@Override
public int deleteDvCheckRecordLineByLineIds(Long[] lineIds)
{
return dvCheckRecordLineMapper.deleteDvCheckRecordLineByLineIds(lineIds);
}
/**
* 删除设备点检记录行信息
*
* @param lineId 设备点检记录行主键
* @return 结果
*/
@Override
public int deleteDvCheckRecordLineByLineId(Long lineId)
{
return dvCheckRecordLineMapper.deleteDvCheckRecordLineByLineId(lineId);
}
@Override
public int deleteDvCheckRecordLineByRecordId(Long recordId) {
return dvCheckRecordLineMapper.deleteDvCheckRecordLineByRecordId(recordId);
}
}

View File

@@ -0,0 +1,97 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.utils.DateUtils;
import com.gear.mes.dv.domain.DvCheckRecord;
import com.gear.mes.dv.mapper.DvCheckRecordMapper;
import com.gear.mes.dv.service.IDvCheckRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备点检记录Service业务层处理
*
* @author yinjinlu
* @date 2024-12-26
*/
@Service
public class DvCheckRecordServiceImpl implements IDvCheckRecordService
{
@Autowired
private DvCheckRecordMapper dvCheckRecordMapper;
/**
* 查询设备点检记录
*
* @param recordId 设备点检记录主键
* @return 设备点检记录
*/
@Override
public DvCheckRecord selectDvCheckRecordByRecordId(Long recordId)
{
return dvCheckRecordMapper.selectDvCheckRecordByRecordId(recordId);
}
/**
* 查询设备点检记录列表
*
* @param dvCheckRecord 设备点检记录
* @return 设备点检记录
*/
@Override
public List<DvCheckRecord> selectDvCheckRecordList(DvCheckRecord dvCheckRecord)
{
return dvCheckRecordMapper.selectDvCheckRecordList(dvCheckRecord);
}
/**
* 新增设备点检记录
*
* @param dvCheckRecord 设备点检记录
* @return 结果
*/
@Override
public int insertDvCheckRecord(DvCheckRecord dvCheckRecord)
{
dvCheckRecord.setCreateTime(DateUtils.getNowDate());
return dvCheckRecordMapper.insertDvCheckRecord(dvCheckRecord);
}
/**
* 修改设备点检记录
*
* @param dvCheckRecord 设备点检记录
* @return 结果
*/
@Override
public int updateDvCheckRecord(DvCheckRecord dvCheckRecord)
{
dvCheckRecord.setUpdateTime(DateUtils.getNowDate());
return dvCheckRecordMapper.updateDvCheckRecord(dvCheckRecord);
}
/**
* 批量删除设备点检记录
*
* @param recordIds 需要删除的设备点检记录主键
* @return 结果
*/
@Override
public int deleteDvCheckRecordByRecordIds(Long[] recordIds)
{
return dvCheckRecordMapper.deleteDvCheckRecordByRecordIds(recordIds);
}
/**
* 删除设备点检记录信息
*
* @param recordId 设备点检记录主键
* @return 结果
*/
@Override
public int deleteDvCheckRecordByRecordId(Long recordId)
{
return dvCheckRecordMapper.deleteDvCheckRecordByRecordId(recordId);
}
}

View File

@@ -0,0 +1,115 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.constant.UserConstants;
import com.gear.common.utils.DateUtils;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvCheckSubject;
import com.gear.mes.dv.mapper.DvCheckSubjectMapper;
import com.gear.mes.dv.service.IDvCheckSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 点检项目Service业务层处理
*
* @author yinjinlu
* @date 2022-06-18
*/
@Service
public class DvCheckSubjectServiceImpl implements IDvCheckSubjectService
{
@Autowired
private DvCheckSubjectMapper dvCheckSubjectMapper;
/**
* 查询点检项目
*
* @param recordId 点检项目主键
* @return 点检项目
*/
@Override
public DvCheckSubject selectDvCheckSubjectByRecordId(Long recordId)
{
return dvCheckSubjectMapper.selectDvCheckSubjectByRecordId(recordId);
}
/**
* 查询点检项目列表
*
* @param dvCheckSubject 点检项目
* @return 点检项目
*/
@Override
public List<DvCheckSubject> selectDvCheckSubjectList(DvCheckSubject dvCheckSubject)
{
return dvCheckSubjectMapper.selectDvCheckSubjectList(dvCheckSubject);
}
@Override
public String checkSubjectUnique(DvCheckSubject dvCheckSubject) {
DvCheckSubject subject = dvCheckSubjectMapper.checkSubjectUnique(dvCheckSubject);
Long recordId = dvCheckSubject.getRecordId()==null?-1L:dvCheckSubject.getRecordId();
if(StringUtils.isNotNull(subject) && subject.getRecordId().longValue() != recordId.longValue()){
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 新增点检项目
*
* @param dvCheckSubject 点检项目
* @return 结果
*/
@Override
public int insertDvCheckSubject(DvCheckSubject dvCheckSubject)
{
dvCheckSubject.setCreateTime(DateUtils.getNowDate());
return dvCheckSubjectMapper.insertDvCheckSubject(dvCheckSubject);
}
/**
* 修改点检项目
*
* @param dvCheckSubject 点检项目
* @return 结果
*/
@Override
public int updateDvCheckSubject(DvCheckSubject dvCheckSubject)
{
dvCheckSubject.setUpdateTime(DateUtils.getNowDate());
return dvCheckSubjectMapper.updateDvCheckSubject(dvCheckSubject);
}
/**
* 批量删除点检项目
*
* @param recordIds 需要删除的点检项目主键
* @return 结果
*/
@Override
public int deleteDvCheckSubjectByRecordIds(Long[] recordIds)
{
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordIds(recordIds);
}
/**
* 删除点检项目信息
*
* @param recordId 点检项目主键
* @return 结果
*/
@Override
public int deleteDvCheckSubjectByRecordId(Long recordId)
{
return dvCheckSubjectMapper.deleteDvCheckSubjectByRecordId(recordId);
}
@Override
public int deleteByPlanId(Long planId) {
return dvCheckSubjectMapper.deleteByPlanId(planId);
}
}

View File

@@ -0,0 +1,177 @@
package com.gear.mes.dv.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.utils.DateUtils;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvMachinery;
import com.gear.mes.dv.mapper.DvMachineryMapper;
import com.gear.mes.dv.service.IDvMachineryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
* 设备Service业务层处理
*
* @author yinjinlu
* @date 2022-05-08
*/
@Service
public class DvMachineryServiceImpl implements IDvMachineryService
{
@Autowired
private DvMachineryMapper dvMachineryMapper;
// @Autowired
// private WmBarCodeUtil wmBarCodeUtil;
/**
* 查询设备
*
* @param machineryId 设备主键
* @return 设备
*/
@Override
public DvMachinery selectDvMachineryByMachineryId(Long machineryId)
{
return dvMachineryMapper.selectDvMachineryByMachineryId(machineryId);
}
/**
* 查询设备列表
*
* @param dvMachinery 设备
* @return 设备
*/
@Override
public List<DvMachinery> selectDvMachineryList(DvMachinery dvMachinery)
{
return dvMachineryMapper.selectDvMachineryList(dvMachinery);
}
/**
* 新增设备
*
* @param dvMachinery 设备
* @return 结果
*/
@Override
public AjaxResult insertDvMachinery(DvMachinery dvMachinery)
{
List<DvMachinery> existing = dvMachineryMapper.selectByMachineryCode(dvMachinery.getMachineryCode());
if (existing != null && existing.size() > 0) {
return AjaxResult.error("设备编码重复");
}
dvMachinery.setCreateTime(DateUtils.getNowDate());
dvMachineryMapper.insertDvMachinery(dvMachinery);
// wmBarCodeUtil.generateBarCode(UserConstants.BARCODE_TYPE_MACHINERY,dvMachinery.getMachineryId(),dvMachinery.getMachineryCode(),dvMachinery.getMachineryName());
return AjaxResult.success("操作成功");
}
/**
* 修改设备
*
* @param dvMachinery 设备
* @return 结果
*/
@Override
public AjaxResult updateDvMachinery(DvMachinery dvMachinery)
{
dvMachinery.setUpdateTime(DateUtils.getNowDate());
return AjaxResult.success(dvMachineryMapper.updateDvMachinery(dvMachinery));
}
/**
* 批量删除设备
*
* @param machineryIds 需要删除的设备主键
* @return 结果
*/
@Override
public int deleteDvMachineryByMachineryIds(Long[] machineryIds)
{
return dvMachineryMapper.deleteDvMachineryByMachineryIds(machineryIds);
}
/**
* 删除设备信息
*
* @param machineryId 设备主键
* @return 结果
*/
@Override
public int deleteDvMachineryByMachineryId(Long machineryId)
{
return dvMachineryMapper.deleteDvMachineryByMachineryId(machineryId);
}
/**
* 依据上传的文件更新或插入设备信息
*/
@Override
public String importMachinery(List<DvMachinery> machineryList, Boolean isUpdateSupport, String operName) {
if (machineryList == null || machineryList.isEmpty()) {
return "导入数据为空";
}
int successCount = 0;
int failureCount = 0;
for (DvMachinery machinery : machineryList) {
// 判断必填项是否为空
if (ObjectUtil.isEmpty(machinery.getMachineryCode())) {
failureCount++;
continue;
}
if (ObjectUtil.isEmpty(machinery.getMachineryName())) {
failureCount++;
continue;
}
if (ObjectUtil.isEmpty(machinery.getMachineryTypeId())) {
failureCount++;
continue;
}
if (ObjectUtil.isEmpty(machinery.getWorkshopId())) {
failureCount++;
continue;
}
if (ObjectUtil.isEmpty(machinery.getStatus())) {
failureCount++;
continue;
}
// 去除空格
String machineryCode = machinery.getMachineryCode().trim();
machinery.setCreateTime(new Date());
List<DvMachinery> existing = dvMachineryMapper.selectByMachineryCode(machineryCode);
if (existing != null && existing.size() > 0) {
if (isUpdateSupport) {
// 更新数据
machinery.setMachineryId(existing.get(0).getMachineryId()); // 确保使用现有 ID 进行更新
dvMachineryMapper.updateDvMachinery(machinery);
successCount++;
} else {
// 不更新数据
failureCount++;
}
} else {
// 新增数据
dvMachineryMapper.insertDvMachinery(machinery);
successCount++;
}
}
return String.format("操作用户:%s导入完成成功 %d 条,失败 %d 条。", operName, successCount, failureCount);
}
@Override
public String checkRecptCodeUnique(DvMachinery dvMachinery) {
DvMachinery machinery = dvMachineryMapper.checkRecptCodeUnique(dvMachinery);
Long machineryId = dvMachinery.getMachineryId() == null ? -1L : dvMachinery.getMachineryId();
if (StringUtils.isNotNull(machinery) && machinery.getMachineryId().longValue() != machineryId.longValue()) {
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
}

View File

@@ -0,0 +1,104 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.utils.DateUtils;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvMachineryType;
import com.gear.mes.dv.mapper.DvMachineryTypeMapper;
import com.gear.mes.dv.service.IDvMachineryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备类型Service业务层处理
*
* @author yinjinlu
* @date 2022-05-08
*/
@Service
public class DvMachineryTypeServiceImpl implements IDvMachineryTypeService
{
@Autowired
private DvMachineryTypeMapper dvMachineryTypeMapper;
/**
* 查询设备类型
*
* @param machineryTypeId 设备类型主键
* @return 设备类型
*/
@Override
public DvMachineryType selectDvMachineryTypeByMachineryTypeId(Long machineryTypeId)
{
return dvMachineryTypeMapper.selectDvMachineryTypeByMachineryTypeId(machineryTypeId);
}
/**
* 查询设备类型列表
*
* @param dvMachineryType 设备类型
* @return 设备类型
*/
@Override
public List<DvMachineryType> selectDvMachineryTypeList(DvMachineryType dvMachineryType)
{
return dvMachineryTypeMapper.selectDvMachineryTypeList(dvMachineryType);
}
/**
* 新增设备类型
*
* @param dvMachineryType 设备类型
* @return 结果
*/
@Override
public int insertDvMachineryType(DvMachineryType dvMachineryType)
{
if(dvMachineryType.getParentTypeId()!= null){
DvMachineryType parent = dvMachineryTypeMapper.selectDvMachineryTypeByMachineryTypeId(dvMachineryType.getParentTypeId());
if(StringUtils.isNotNull(parent)){
dvMachineryType.setAncestors(parent.getAncestors()+","+parent.getMachineryTypeId());
}
}
dvMachineryType.setCreateTime(DateUtils.getNowDate());
return dvMachineryTypeMapper.insertDvMachineryType(dvMachineryType);
}
/**
* 修改设备类型
*
* @param dvMachineryType 设备类型
* @return 结果
*/
@Override
public int updateDvMachineryType(DvMachineryType dvMachineryType)
{
dvMachineryType.setUpdateTime(DateUtils.getNowDate());
return dvMachineryTypeMapper.updateDvMachineryType(dvMachineryType);
}
/**
* 批量删除设备类型
*
* @param machineryTypeIds 需要删除的设备类型主键
* @return 结果
*/
@Override
public int deleteDvMachineryTypeByMachineryTypeIds(Long[] machineryTypeIds)
{
return dvMachineryTypeMapper.deleteDvMachineryTypeByMachineryTypeIds(machineryTypeIds);
}
/**
* 删除设备类型信息
*
* @param machineryTypeId 设备类型主键
* @return 结果
*/
@Override
public int deleteDvMachineryTypeByMachineryTypeId(Long machineryTypeId)
{
return dvMachineryTypeMapper.deleteDvMachineryTypeByMachineryTypeId(machineryTypeId);
}
}

View File

@@ -0,0 +1,97 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.utils.DateUtils;
import com.gear.mes.dv.domain.DvMaintenRecordLine;
import com.gear.mes.dv.mapper.DvMaintenRecordLineMapper;
import com.gear.mes.dv.service.IDvMaintenRecordLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备保养记录行Service业务层处理
*
* @author yinjinlu
* @date 2024-12-26
*/
@Service
public class DvMaintenRecordLineServiceImpl implements IDvMaintenRecordLineService
{
@Autowired
private DvMaintenRecordLineMapper dvMaintenRecordLineMapper;
/**
* 查询设备保养记录行
*
* @param lineId 设备保养记录行主键
* @return 设备保养记录行
*/
@Override
public DvMaintenRecordLine selectDvMaintenRecordLineByLineId(Long lineId)
{
return dvMaintenRecordLineMapper.selectDvMaintenRecordLineByLineId(lineId);
}
/**
* 查询设备保养记录行列表
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 设备保养记录行
*/
@Override
public List<DvMaintenRecordLine> selectDvMaintenRecordLineList(DvMaintenRecordLine dvMaintenRecordLine)
{
return dvMaintenRecordLineMapper.selectDvMaintenRecordLineList(dvMaintenRecordLine);
}
/**
* 新增设备保养记录行
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 结果
*/
@Override
public int insertDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine)
{
dvMaintenRecordLine.setCreateTime(DateUtils.getNowDate());
return dvMaintenRecordLineMapper.insertDvMaintenRecordLine(dvMaintenRecordLine);
}
/**
* 修改设备保养记录行
*
* @param dvMaintenRecordLine 设备保养记录行
* @return 结果
*/
@Override
public int updateDvMaintenRecordLine(DvMaintenRecordLine dvMaintenRecordLine)
{
dvMaintenRecordLine.setUpdateTime(DateUtils.getNowDate());
return dvMaintenRecordLineMapper.updateDvMaintenRecordLine(dvMaintenRecordLine);
}
/**
* 批量删除设备保养记录行
*
* @param lineIds 需要删除的设备保养记录行主键
* @return 结果
*/
@Override
public int deleteDvMaintenRecordLineByLineIds(Long[] lineIds)
{
return dvMaintenRecordLineMapper.deleteDvMaintenRecordLineByLineIds(lineIds);
}
/**
* 删除设备保养记录行信息
*
* @param lineId 设备保养记录行主键
* @return 结果
*/
@Override
public int deleteDvMaintenRecordLineByLineId(Long lineId)
{
return dvMaintenRecordLineMapper.deleteDvMaintenRecordLineByLineId(lineId);
}
}

View File

@@ -0,0 +1,97 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.utils.DateUtils;
import com.gear.mes.dv.domain.DvMaintenRecord;
import com.gear.mes.dv.mapper.DvMaintenRecordMapper;
import com.gear.mes.dv.service.IDvMaintenRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备保养记录Service业务层处理
*
* @author yinjinlu
* @date 2024-12-26
*/
@Service
public class DvMaintenRecordServiceImpl implements IDvMaintenRecordService
{
@Autowired
private DvMaintenRecordMapper dvMaintenRecordMapper;
/**
* 查询设备保养记录
*
* @param recordId 设备保养记录主键
* @return 设备保养记录
*/
@Override
public DvMaintenRecord selectDvMaintenRecordByRecordId(Long recordId)
{
return dvMaintenRecordMapper.selectDvMaintenRecordByRecordId(recordId);
}
/**
* 查询设备保养记录列表
*
* @param dvMaintenRecord 设备保养记录
* @return 设备保养记录
*/
@Override
public List<DvMaintenRecord> selectDvMaintenRecordList(DvMaintenRecord dvMaintenRecord)
{
return dvMaintenRecordMapper.selectDvMaintenRecordList(dvMaintenRecord);
}
/**
* 新增设备保养记录
*
* @param dvMaintenRecord 设备保养记录
* @return 结果
*/
@Override
public int insertDvMaintenRecord(DvMaintenRecord dvMaintenRecord)
{
dvMaintenRecord.setCreateTime(DateUtils.getNowDate());
return dvMaintenRecordMapper.insertDvMaintenRecord(dvMaintenRecord);
}
/**
* 修改设备保养记录
*
* @param dvMaintenRecord 设备保养记录
* @return 结果
*/
@Override
public int updateDvMaintenRecord(DvMaintenRecord dvMaintenRecord)
{
dvMaintenRecord.setUpdateTime(DateUtils.getNowDate());
return dvMaintenRecordMapper.updateDvMaintenRecord(dvMaintenRecord);
}
/**
* 批量删除设备保养记录
*
* @param recordIds 需要删除的设备保养记录主键
* @return 结果
*/
@Override
public int deleteDvMaintenRecordByRecordIds(Long[] recordIds)
{
return dvMaintenRecordMapper.deleteDvMaintenRecordByRecordIds(recordIds);
}
/**
* 删除设备保养记录信息
*
* @param recordId 设备保养记录主键
* @return 结果
*/
@Override
public int deleteDvMaintenRecordByRecordId(Long recordId)
{
return dvMaintenRecordMapper.deleteDvMaintenRecordByRecordId(recordId);
}
}

View File

@@ -0,0 +1,102 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.utils.DateUtils;
import com.gear.mes.dv.domain.DvRepairLine;
import com.gear.mes.dv.mapper.DvRepairLineMapper;
import com.gear.mes.dv.service.IDvRepairLineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备维修单行Service业务层处理
*
* @author yinjinlu
* @date 2022-08-08
*/
@Service
public class DvRepairLineServiceImpl implements IDvRepairLineService
{
@Autowired
private DvRepairLineMapper dvRepairLineMapper;
/**
* 查询设备维修单行
*
* @param lineId 设备维修单行主键
* @return 设备维修单行
*/
@Override
public DvRepairLine selectDvRepairLineByLineId(Long lineId)
{
return dvRepairLineMapper.selectDvRepairLineByLineId(lineId);
}
/**
* 查询设备维修单行列表
*
* @param dvRepairLine 设备维修单行
* @return 设备维修单行
*/
@Override
public List<DvRepairLine> selectDvRepairLineList(DvRepairLine dvRepairLine)
{
return dvRepairLineMapper.selectDvRepairLineList(dvRepairLine);
}
/**
* 新增设备维修单行
*
* @param dvRepairLine 设备维修单行
* @return 结果
*/
@Override
public int insertDvRepairLine(DvRepairLine dvRepairLine)
{
dvRepairLine.setCreateTime(DateUtils.getNowDate());
return dvRepairLineMapper.insertDvRepairLine(dvRepairLine);
}
/**
* 修改设备维修单行
*
* @param dvRepairLine 设备维修单行
* @return 结果
*/
@Override
public int updateDvRepairLine(DvRepairLine dvRepairLine)
{
dvRepairLine.setUpdateTime(DateUtils.getNowDate());
return dvRepairLineMapper.updateDvRepairLine(dvRepairLine);
}
/**
* 批量删除设备维修单行
*
* @param lineIds 需要删除的设备维修单行主键
* @return 结果
*/
@Override
public int deleteDvRepairLineByLineIds(Long[] lineIds)
{
return dvRepairLineMapper.deleteDvRepairLineByLineIds(lineIds);
}
/**
* 删除设备维修单行信息
*
* @param lineId 设备维修单行主键
* @return 结果
*/
@Override
public int deleteDvRepairLineByLineId(Long lineId)
{
return dvRepairLineMapper.deleteDvRepairLineByLineId(lineId);
}
@Override
public int deleteByRepairId(Long repairId) {
return dvRepairLineMapper.deleteByRepairId(repairId);
}
}

View File

@@ -0,0 +1,122 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.constant.UserConstants;
import com.gear.common.core.domain.AjaxResult;
import com.gear.common.utils.DateUtils;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvRepair;
import com.gear.mes.dv.domain.dto.DvRepairDTO;
import com.gear.mes.dv.mapper.DvRepairMapper;
import com.gear.mes.dv.service.IDvRepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备维修单Service业务层处理
*
* @author yinjinlu
* @date 2022-08-06
*/
@Service
public class DvRepairServiceImpl implements IDvRepairService
{
@Autowired
private DvRepairMapper dvRepairMapper;
/**
* 查询设备维修单
*
* @param repairId 设备维修单主键
* @return 设备维修单
*/
@Override
public DvRepair selectDvRepairByRepairId(Long repairId)
{
return dvRepairMapper.selectDvRepairByRepairId(repairId);
}
/**
* 查询设备维修单列表
*
* @param dvRepair 设备维修单
* @return 设备维修单
*/
@Override
public List<DvRepair> selectDvRepairList(DvRepair dvRepair)
{
return dvRepairMapper.selectDvRepairList(dvRepair);
}
@Override
public String checkCodeUnique(DvRepair dvRepair) {
DvRepair rp = dvRepairMapper.checkCodeUnique(dvRepair);
Long repairId = dvRepair.getRepairId() ==null?-1L: dvRepair.getRepairId();
if(StringUtils.isNotNull(rp) && repairId.longValue() != rp.getRepairId().longValue()){
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 新增设备维修单
*
* @param dvRepair 设备维修单
* @return 结果
*/
@Override
public int insertDvRepair(DvRepair dvRepair)
{
dvRepair.setCreateTime(DateUtils.getNowDate());
return dvRepairMapper.insertDvRepair(dvRepair);
}
/**
* 修改设备维修单
*
* @param dvRepair 设备维修单
* @return 结果
*/
@Override
public int updateDvRepair(DvRepair dvRepair)
{
dvRepair.setUpdateTime(DateUtils.getNowDate());
return dvRepairMapper.updateDvRepair(dvRepair);
}
/**
* 批量删除设备维修单
*
* @param repairIds 需要删除的设备维修单主键
* @return 结果
*/
@Override
public int deleteDvRepairByRepairIds(Long[] repairIds)
{
return dvRepairMapper.deleteDvRepairByRepairIds(repairIds);
}
/**
* 删除设备维修单信息
*
* @param repairId 设备维修单主键
* @return 结果
*/
@Override
public int deleteDvRepairByRepairId(Long repairId)
{
return dvRepairMapper.deleteDvRepairByRepairId(repairId);
}
/**
* 根据设备编码查询设备维修单列表
* @param repairDTO
* @return
*/
@Override
public AjaxResult getRepairList(DvRepairDTO repairDTO) {
List<DvRepair> list = dvRepairMapper.getRepairList(repairDTO.getMachineryCode());
return AjaxResult.success(list);
}
}

View File

@@ -0,0 +1,122 @@
package com.gear.mes.dv.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gear.common.core.domain.PageQuery;
import com.gear.common.core.page.TableDataInfo;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvSpecialEquipment;
import com.gear.mes.dv.domain.bo.DvSpecialEquipmentBo;
import com.gear.mes.dv.domain.vo.DvSpecialEquipmentVo;
import com.gear.mes.dv.mapper.DvSpecialEquipmentMapper;
import com.gear.mes.dv.service.IDvSpecialEquipmentService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/**
* 特种设备包含锅炉、压力管道、电梯等特种设备信息Service业务层处理
*
* @author klp
* @date 2025-08-21
*/
@RequiredArgsConstructor
@Service
public class DvSpecialEquipmentServiceImpl implements IDvSpecialEquipmentService {
private final DvSpecialEquipmentMapper baseMapper;
/**
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
@Override
public DvSpecialEquipmentVo queryById(Long equipmentId){
return baseMapper.selectVoById(equipmentId);
}
/**
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
*/
@Override
public TableDataInfo<DvSpecialEquipmentVo> queryPageList(DvSpecialEquipmentBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<DvSpecialEquipment> lqw = buildQueryWrapper(bo);
Page<DvSpecialEquipmentVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询特种设备(包含锅炉、压力管道、电梯等特种设备信息)列表
*/
@Override
public List<DvSpecialEquipmentVo> queryList(DvSpecialEquipmentBo bo) {
LambdaQueryWrapper<DvSpecialEquipment> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<DvSpecialEquipment> buildQueryWrapper(DvSpecialEquipmentBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<DvSpecialEquipment> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getEquipmentCode()), DvSpecialEquipment::getEquipmentCode, bo.getEquipmentCode());
lqw.like(StringUtils.isNotBlank(bo.getEquipmentName()), DvSpecialEquipment::getEquipmentName, bo.getEquipmentName());
lqw.eq(StringUtils.isNotBlank(bo.getSpecificationModel()), DvSpecialEquipment::getSpecificationModel, bo.getSpecificationModel());
lqw.eq(StringUtils.isNotBlank(bo.getManufacturer()), DvSpecialEquipment::getManufacturer, bo.getManufacturer());
lqw.eq(bo.getProductionDate() != null, DvSpecialEquipment::getProductionDate, bo.getProductionDate());
lqw.eq(bo.getInstallationDate() != null, DvSpecialEquipment::getInstallationDate, bo.getInstallationDate());
lqw.eq(bo.getUseStartDate() != null, DvSpecialEquipment::getUseStartDate, bo.getUseStartDate());
lqw.eq(StringUtils.isNotBlank(bo.getRegistrationNo()), DvSpecialEquipment::getRegistrationNo, bo.getRegistrationNo());
lqw.eq(StringUtils.isNotBlank(bo.getSafetyManager()), DvSpecialEquipment::getSafetyManager, bo.getSafetyManager());
lqw.eq(StringUtils.isNotBlank(bo.getAttachment()), DvSpecialEquipment::getAttachment, bo.getAttachment());
lqw.eq(bo.getInspectionCycle() != null, DvSpecialEquipment::getInspectionCycle, bo.getInspectionCycle());
lqw.eq(bo.getLastInspectionTime() != null, DvSpecialEquipment::getLastInspectionTime, bo.getLastInspectionTime());
lqw.eq(bo.getNextInspectionTime() != null, DvSpecialEquipment::getNextInspectionTime, bo.getNextInspectionTime());
lqw.eq(StringUtils.isNotBlank(bo.getCurrentStatus()), DvSpecialEquipment::getCurrentStatus, bo.getCurrentStatus());
return lqw;
}
/**
* 新增特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
@Override
public Boolean insertByBo(DvSpecialEquipmentBo bo) {
DvSpecialEquipment add = BeanUtil.toBean(bo, DvSpecialEquipment.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setEquipmentId(add.getEquipmentId());
}
return flag;
}
/**
* 修改特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
@Override
public Boolean updateByBo(DvSpecialEquipmentBo bo) {
DvSpecialEquipment update = BeanUtil.toBean(bo, DvSpecialEquipment.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(DvSpecialEquipment entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除特种设备(包含锅炉、压力管道、电梯等特种设备信息)
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

View File

@@ -0,0 +1,109 @@
package com.gear.mes.dv.service.impl;
import com.gear.common.constant.UserConstants;
import com.gear.common.utils.DateUtils;
import com.gear.common.utils.StringUtils;
import com.gear.mes.dv.domain.DvSubject;
import com.gear.mes.dv.mapper.DvSubjectMapper;
import com.gear.mes.dv.service.IDvSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备点检保养项目Service业务层处理
*
* @author yinjinlu
* @date 2022-06-16
*/
@Service
public class DvSubjectServiceImpl implements IDvSubjectService
{
@Autowired
private DvSubjectMapper dvSubjectMapper;
/**
* 查询设备点检保养项目
*
* @param subjectId 设备点检保养项目主键
* @return 设备点检保养项目
*/
@Override
public DvSubject selectDvSubjectBySubjectId(Long subjectId)
{
return dvSubjectMapper.selectDvSubjectBySubjectId(subjectId);
}
/**
* 查询设备点检保养项目列表
*
* @param dvSubject 设备点检保养项目
* @return 设备点检保养项目
*/
@Override
public List<DvSubject> selectDvSubjectList(DvSubject dvSubject)
{
return dvSubjectMapper.selectDvSubjectList(dvSubject);
}
@Override
public String checkSubjectCodeUnique(DvSubject dvSubject) {
DvSubject subject = dvSubjectMapper.checkSubjectCodeUnique(dvSubject);
Long subjectId = dvSubject.getSubjectId()==null?-1L:dvSubject.getSubjectId();
if(StringUtils.isNotNull(subject) && subject.getSubjectId().longValue() != subjectId.longValue()){
return UserConstants.NOT_UNIQUE;
}
return UserConstants.UNIQUE;
}
/**
* 新增设备点检保养项目
*
* @param dvSubject 设备点检保养项目
* @return 结果
*/
@Override
public int insertDvSubject(DvSubject dvSubject)
{
dvSubject.setCreateTime(DateUtils.getNowDate());
return dvSubjectMapper.insertDvSubject(dvSubject);
}
/**
* 修改设备点检保养项目
*
* @param dvSubject 设备点检保养项目
* @return 结果
*/
@Override
public int updateDvSubject(DvSubject dvSubject)
{
dvSubject.setUpdateTime(DateUtils.getNowDate());
return dvSubjectMapper.updateDvSubject(dvSubject);
}
/**
* 批量删除设备点检保养项目
*
* @param subjectIds 需要删除的设备点检保养项目主键
* @return 结果
*/
@Override
public int deleteDvSubjectBySubjectIds(Long[] subjectIds)
{
return dvSubjectMapper.deleteDvSubjectBySubjectIds(subjectIds);
}
/**
* 删除设备点检保养项目信息
*
* @param subjectId 设备点检保养项目主键
* @return 结果
*/
@Override
public int deleteDvSubjectBySubjectId(Long subjectId)
{
return dvSubjectMapper.deleteDvSubjectBySubjectId(subjectId);
}
}