|
@@ -20,6 +20,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
+import org.jeecg.modules.util.AutoCodeUtil;
|
|
|
+import org.jeecg.modules.util.UserConstants;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
@@ -49,7 +51,18 @@ import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
public class CmmsSpotcheckItemController extends JeecgController<CmmsSpotcheckItem, ICmmsSpotcheckItemService> {
|
|
|
@Autowired
|
|
|
private ICmmsSpotcheckItemService cmmsSpotcheckItemService;
|
|
|
-
|
|
|
+ @Autowired
|
|
|
+ private AutoCodeUtil autoCodeUtil;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 依据设备ID获取点检项信息
|
|
|
+ */
|
|
|
+ @ApiOperation("依据设备ID获取点检项信息")
|
|
|
+ @GetMapping(value = "/listbyequipmentid/{equipmentid}")
|
|
|
+ public Result<List<CmmsSpotcheckItem>> listByEquipmentid(@PathVariable("equipmentid") String equipmentid) {
|
|
|
+ return Result.OK(cmmsSpotcheckItemService.selectCmmsSpotcheckItemByEquipmentid(equipmentid));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 分页列表查询
|
|
|
*
|
|
@@ -71,7 +84,7 @@ public class CmmsSpotcheckItemController extends JeecgController<CmmsSpotcheckIt
|
|
|
IPage<CmmsSpotcheckItem> pageList = cmmsSpotcheckItemService.page(page, queryWrapper);
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 添加
|
|
|
*
|
|
@@ -83,10 +96,14 @@ public class CmmsSpotcheckItemController extends JeecgController<CmmsSpotcheckIt
|
|
|
//@RequiresPermissions("org.jeecg.modules:ems_cmms_spotcheck_item:add")
|
|
|
@PostMapping(value = "/add")
|
|
|
public Result<String> add(@RequestBody CmmsSpotcheckItem cmmsSpotcheckItem) {
|
|
|
+ //生成点检项编号
|
|
|
+ if (cmmsSpotcheckItem.getItemcode() == null || "".equals(cmmsSpotcheckItem.getItemcode())) {
|
|
|
+ cmmsSpotcheckItem.setItemcode(autoCodeUtil.genSerialCode(UserConstants.CMMSSPOTCHECKITEM_CODE, null));
|
|
|
+ }
|
|
|
cmmsSpotcheckItemService.save(cmmsSpotcheckItem);
|
|
|
return Result.OK("添加成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 编辑
|
|
|
*
|
|
@@ -101,7 +118,7 @@ public class CmmsSpotcheckItemController extends JeecgController<CmmsSpotcheckIt
|
|
|
cmmsSpotcheckItemService.updateById(cmmsSpotcheckItem);
|
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id删除
|
|
|
*
|
|
@@ -116,7 +133,7 @@ public class CmmsSpotcheckItemController extends JeecgController<CmmsSpotcheckIt
|
|
|
cmmsSpotcheckItemService.removeById(id);
|
|
|
return Result.OK("删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 批量删除
|
|
|
*
|
|
@@ -131,7 +148,7 @@ public class CmmsSpotcheckItemController extends JeecgController<CmmsSpotcheckIt
|
|
|
this.cmmsSpotcheckItemService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
return Result.OK("批量删除成功!");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 通过id查询
|
|
|
*
|