commit
e6761d6633
48 changed files with 1757 additions and 55 deletions
@ -0,0 +1,126 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.inspection.controller; |
||||
|
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import lombok.AllArgsConstructor; |
||||
import javax.validation.Valid; |
||||
|
||||
import com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.core.tool.utils.Func; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.inspection.entity.InspectionResult; |
||||
import org.energy.modules.inspection.vo.InspectionResultVO; |
||||
import org.energy.modules.inspection.service.IInspectionResultService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
|
||||
/** |
||||
* 巡检结果 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/inspection/inspectionresult") |
||||
@Api(value = "巡检结果", tags = "巡检结果接口") |
||||
public class InspectionResultController extends DafController { |
||||
|
||||
private IInspectionResultService inspectionResultService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入inspectionResult") |
||||
public R<InspectionResult> detail(InspectionResult inspectionResult) { |
||||
InspectionResult detail = inspectionResultService.getOne(Condition.getQueryWrapper(inspectionResult)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 巡检结果 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionResult") |
||||
public R<IPage<InspectionResult>> list(InspectionResult inspectionResult, Query query) { |
||||
IPage<InspectionResult> pages = inspectionResultService.page(Condition.getPage(query), Condition.getQueryWrapper(inspectionResult)); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 巡检结果 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionResult") |
||||
public R<IPage<InspectionResultVO>> page(InspectionResultVO inspectionResult, Query query) { |
||||
IPage<InspectionResultVO> pages = inspectionResultService.selectInspectionResultPage(Condition.getPage(query), inspectionResult); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 巡检结果 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入inspectionResult") |
||||
public R save(@Valid @RequestBody InspectionResult inspectionResult) { |
||||
return R.status(inspectionResultService.save(inspectionResult)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 巡检结果 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入inspectionResult") |
||||
public R update(@Valid @RequestBody InspectionResult inspectionResult) { |
||||
return R.status(inspectionResultService.updateById(inspectionResult)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 巡检结果 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入inspectionResult") |
||||
public R submit(@Valid @RequestBody InspectionResult inspectionResult) { |
||||
return R.status(inspectionResultService.saveOrUpdate(inspectionResult)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 巡检结果 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(inspectionResultService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,249 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.inspection.controller; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dayu.daf.core.log.annotation.ApiLog; |
||||
import com.dayu.daf.core.tool.constant.DafConstant; |
||||
import com.xkcoding.http.util.StringUtil; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import lombok.AllArgsConstructor; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
import com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.core.tool.utils.Func; |
||||
import lombok.SneakyThrows; |
||||
import org.apache.commons.codec.Charsets; |
||||
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
||||
import org.energy.modules.leger.entity.EquipmentLedger; |
||||
import org.energy.modules.system.entity.Dict; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.inspection.entity.InspectionRoute; |
||||
import org.energy.modules.inspection.vo.InspectionRouteVO; |
||||
import org.energy.modules.inspection.service.IInspectionRouteService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.net.URLEncoder; |
||||
import java.time.LocalDate; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 巡检路线 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/inspection/inspectionRoute") |
||||
@Api(value = "巡检路线", tags = "巡检路线接口") |
||||
public class InspectionRouteController extends DafController { |
||||
|
||||
private IInspectionRouteService inspectionRouteService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入inspectionRoute") |
||||
public R<InspectionRoute> detail(InspectionRoute inspectionRoute) { |
||||
InspectionRoute detail = inspectionRouteService.getOne(Condition.getQueryWrapper(inspectionRoute)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 巡检路线 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionRoute") |
||||
public R<IPage<InspectionRoute>> list(InspectionRoute inspectionRoute, Query query) { |
||||
QueryWrapper<InspectionRoute> qw = new QueryWrapper<>(); |
||||
qw.orderByAsc("route_no"); |
||||
if (StringUtil.isNotEmpty(inspectionRoute.getRouteNo())) { |
||||
qw.lambda().like(InspectionRoute::getRouteNo, inspectionRoute.getRouteNo()); |
||||
} |
||||
if (StringUtil.isNotEmpty(inspectionRoute.getRouteName())) { |
||||
qw.lambda().like(InspectionRoute::getRouteName, inspectionRoute.getRouteName()); |
||||
} |
||||
if (null != inspectionRoute.getStations()) { |
||||
qw.lambda().eq(InspectionRoute::getStations, inspectionRoute.getStations()); |
||||
} |
||||
if (StringUtil.isNotEmpty(inspectionRoute.getType())) { |
||||
qw.lambda().like(InspectionRoute::getType, inspectionRoute.getType()); |
||||
} |
||||
if (null != inspectionRoute.getIstatus()) { |
||||
qw.lambda().eq(InspectionRoute::getIstatus, inspectionRoute.getIstatus()); |
||||
} |
||||
IPage<InspectionRoute> pages = inspectionRouteService.page(Condition.getPage(query), qw); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 巡检路线 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionRoute") |
||||
public R<IPage<InspectionRouteVO>> page(InspectionRouteVO inspectionRoute, Query query) { |
||||
IPage<InspectionRouteVO> pages = inspectionRouteService.selectInspectionRoutePage(Condition.getPage(query), inspectionRoute); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 巡检路线 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入inspectionRoute") |
||||
public R save(@Valid @RequestBody InspectionRoute inspectionRoute) { |
||||
return R.status(inspectionRouteService.save(inspectionRoute)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 巡检路线 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入inspectionRoute") |
||||
public R update(@Valid @RequestBody InspectionRoute inspectionRoute) { |
||||
return R.status(inspectionRouteService.updateById(inspectionRoute)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 巡检路线 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入inspectionRoute") |
||||
public R submit(@Valid @RequestBody InspectionRoute inspectionRoute) { |
||||
inspectionRoute.setIstatus(1); |
||||
String date = LocalDate.now().toString().replace("-",""); |
||||
String maxNo = inspectionRouteService.getMaxNo("'%" + date + "%'"); |
||||
int number; |
||||
if (StringUtil.isNotEmpty(maxNo)){ |
||||
number = Integer.parseInt(maxNo.substring(9)); |
||||
number++; |
||||
}else{ |
||||
number = 1; |
||||
} |
||||
String numFormat = String.format("%04d", number); |
||||
String no = "R" + date + numFormat; |
||||
inspectionRoute.setRouteNo(no); |
||||
return R.status(inspectionRouteService.saveOrUpdate(inspectionRoute)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 巡检路线 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(inspectionRouteService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
|
||||
|
||||
/** |
||||
* 生效 |
||||
*/ |
||||
@PostMapping("/takeEffect") |
||||
@ApiOperationSupport(order = 8) |
||||
@ApiOperation(value = "生效", notes = "传入ids") |
||||
public R takeEffect(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.updateInspectionRoute(1,ids); |
||||
} |
||||
|
||||
/** |
||||
* 失效 |
||||
*/ |
||||
@PostMapping("/lapse") |
||||
@ApiOperationSupport(order = 9) |
||||
@ApiOperation(value = "失效", notes = "传入ids") |
||||
public R lapse(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.updateInspectionRoute(0,ids); |
||||
} |
||||
|
||||
/** |
||||
* 生效OR失效 |
||||
*/ |
||||
public R updateInspectionRoute(Integer status, String ids) { |
||||
List<InspectionRoute> list = new ArrayList<>(); |
||||
for (String id : ids.split(",")) { |
||||
InspectionRoute inspectionRoute = new InspectionRoute(); |
||||
inspectionRoute.setId(Long.parseLong(id)); |
||||
inspectionRoute.setIstatus(status); |
||||
list.add(inspectionRoute); |
||||
} |
||||
return R.status(inspectionRouteService.updateBatchById(list)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
@SneakyThrows |
||||
@GetMapping("export") |
||||
@ApiOperationSupport(order = 10) |
||||
@ApiOperation(value = "导出", notes = "传入") |
||||
@ApiLog |
||||
public void exportInspectionRoute(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
||||
if (entity.containsKey("stations_equal")) { |
||||
entity.put("stations_equal", Integer.parseInt((String) entity.get("stations_equal"))); |
||||
} |
||||
if (entity.containsKey("istatus_equal")) { |
||||
entity.put("istatus_equal", Integer.parseInt((String) entity.get("istatus_equal"))); |
||||
} |
||||
QueryWrapper<InspectionRoute> queryWrapper = Condition.getQueryWrapper(entity, InspectionRoute.class); |
||||
queryWrapper.lambda().eq(InspectionRoute::getIsDeleted, DafConstant.DB_NOT_DELETED); |
||||
queryWrapper.orderByAsc("route_no"); |
||||
|
||||
List<InspectionRouteExcel> list = inspectionRouteService.export(queryWrapper); |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||
String fileName = URLEncoder.encode("巡检路线数据导出", Charsets.UTF_8.name()); |
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
||||
EasyExcel.write(response.getOutputStream(), InspectionRouteExcel.class).sheet("巡检路线").doWrite(list); |
||||
} |
||||
|
||||
/** |
||||
* 获取路线编号 |
||||
*/ |
||||
@GetMapping("/getRouteList") |
||||
@ApiOperationSupport(order = 11) |
||||
@ApiOperation(value = "获取路线编号", notes = "获取路线编号") |
||||
public R<List<InspectionRoute>> getRouteList() { |
||||
List<InspectionRoute> routeList = inspectionRouteService.getRouteList(); |
||||
return R.data(routeList); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,246 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE 3.0; |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.gnu.org/licenses/lgpl.html
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.inspection.controller; |
||||
|
||||
import com.alibaba.excel.EasyExcel; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.dayu.daf.core.log.annotation.ApiLog; |
||||
import com.dayu.daf.core.tool.constant.DafConstant; |
||||
import com.xkcoding.http.util.StringUtil; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||
import lombok.AllArgsConstructor; |
||||
|
||||
import javax.servlet.http.HttpServletResponse; |
||||
import javax.validation.Valid; |
||||
|
||||
import com.dayu.daf.core.mp.support.Condition; |
||||
import com.dayu.daf.core.mp.support.Query; |
||||
import com.dayu.daf.core.tool.api.R; |
||||
import com.dayu.daf.core.tool.utils.Func; |
||||
import lombok.SneakyThrows; |
||||
import org.apache.commons.codec.Charsets; |
||||
import org.energy.modules.inspection.excel.InspectionTasksExcel; |
||||
import org.energy.modules.leger.entity.EquipmentLedger; |
||||
import org.energy.modules.leger.excel.EquipmentLedgerExcel; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.bind.annotation.RequestParam; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.inspection.entity.InspectionTasks; |
||||
import org.energy.modules.inspection.vo.InspectionTasksVO; |
||||
import org.energy.modules.inspection.service.IInspectionTasksService; |
||||
import com.dayu.daf.core.boot.ctrl.DafController; |
||||
import springfox.documentation.annotations.ApiIgnore; |
||||
|
||||
import java.net.URLEncoder; |
||||
import java.time.LocalDate; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 巡检任务 控制器 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/inspection/inspectiontasks") |
||||
@Api(value = "巡检任务", tags = "巡检任务接口") |
||||
public class InspectionTasksController extends DafController { |
||||
|
||||
private IInspectionTasksService inspectionTasksService; |
||||
|
||||
/** |
||||
* 详情 |
||||
*/ |
||||
@GetMapping("/detail") |
||||
@ApiOperationSupport(order = 1) |
||||
@ApiOperation(value = "详情", notes = "传入inspectionTasks") |
||||
public R<InspectionTasks> detail(InspectionTasks inspectionTasks) { |
||||
InspectionTasks detail = inspectionTasksService.getOne(Condition.getQueryWrapper(inspectionTasks)); |
||||
return R.data(detail); |
||||
} |
||||
|
||||
/** |
||||
* 分页 巡检任务 |
||||
*/ |
||||
@GetMapping("/list") |
||||
@ApiOperationSupport(order = 2) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionTasks") |
||||
public R<IPage<InspectionTasks>> list(InspectionTasks inspectionTasks, Query query) { |
||||
QueryWrapper<InspectionTasks> qw = new QueryWrapper<>(); |
||||
// 场站
|
||||
if (null != inspectionTasks.getStation()) { |
||||
qw.lambda().eq(InspectionTasks::getStation, inspectionTasks.getStation()); |
||||
} |
||||
// 状态
|
||||
if (null != inspectionTasks.getTaskStatus()) { |
||||
qw.lambda().eq(InspectionTasks::getTaskStatus, inspectionTasks.getTaskStatus()); |
||||
} |
||||
// 任务编号
|
||||
if (StringUtil.isNotEmpty(inspectionTasks.getTaskNo())) { |
||||
qw.lambda().like(InspectionTasks::getTaskNo, inspectionTasks.getTaskNo()); |
||||
} |
||||
// 任务名称
|
||||
if (StringUtil.isNotEmpty(inspectionTasks.getTaskName())) { |
||||
qw.lambda().like(InspectionTasks::getTaskName, inspectionTasks.getTaskName()); |
||||
} |
||||
// 任务生成日期
|
||||
if (StringUtil.isNotEmpty(inspectionTasks.getTaskStartDate())) { |
||||
qw.lambda().like(InspectionTasks::getTaskStartDate, inspectionTasks.getTaskStartDate()); |
||||
} |
||||
// 任务完成日期
|
||||
if (StringUtil.isNotEmpty(inspectionTasks.getTaskEndDate())) { |
||||
qw.lambda().like(InspectionTasks::getTaskEndDate, inspectionTasks.getTaskEndDate()); |
||||
} |
||||
// 责任人
|
||||
if (StringUtil.isNotEmpty(inspectionTasks.getResponsiblePerson())) { |
||||
qw.lambda().like(InspectionTasks::getResponsiblePerson, inspectionTasks.getResponsiblePerson()); |
||||
} |
||||
IPage<InspectionTasks> pages = inspectionTasksService.page(Condition.getPage(query), qw); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 自定义分页 巡检任务 |
||||
*/ |
||||
@GetMapping("/page") |
||||
@ApiOperationSupport(order = 3) |
||||
@ApiOperation(value = "分页", notes = "传入inspectionTasks") |
||||
public R<IPage<InspectionTasksVO>> page(InspectionTasksVO inspectionTasks, Query query) { |
||||
IPage<InspectionTasksVO> pages = inspectionTasksService.selectInspectionTasksPage(Condition.getPage(query), inspectionTasks); |
||||
return R.data(pages); |
||||
} |
||||
|
||||
/** |
||||
* 新增 巡检任务 |
||||
*/ |
||||
@PostMapping("/save") |
||||
@ApiOperationSupport(order = 4) |
||||
@ApiOperation(value = "新增", notes = "传入inspectionTasks") |
||||
public R save(@Valid @RequestBody InspectionTasks inspectionTasks) { |
||||
return R.status(inspectionTasksService.save(inspectionTasks)); |
||||
} |
||||
|
||||
/** |
||||
* 修改 巡检任务 |
||||
*/ |
||||
@PostMapping("/update") |
||||
@ApiOperationSupport(order = 5) |
||||
@ApiOperation(value = "修改", notes = "传入inspectionTasks") |
||||
public R update(@Valid @RequestBody InspectionTasks inspectionTasks) { |
||||
return R.status(inspectionTasksService.updateById(inspectionTasks)); |
||||
} |
||||
|
||||
/** |
||||
* 新增或修改 巡检任务 |
||||
*/ |
||||
@PostMapping("/submit") |
||||
@ApiOperationSupport(order = 6) |
||||
@ApiOperation(value = "新增或修改", notes = "传入inspectionTasks") |
||||
public R submit(@Valid @RequestBody InspectionTasks inspectionTasks) { |
||||
inspectionTasks.setTaskStatus(1L); |
||||
String date = LocalDate.now().toString().replace("-",""); |
||||
String maxTaskNo = inspectionTasksService.getMaxTaskNo("'%" + date + "%'"); |
||||
int number; |
||||
if (StringUtil.isNotEmpty(maxTaskNo)){ |
||||
number = Integer.parseInt(maxTaskNo.substring(9)); |
||||
number++; |
||||
}else{ |
||||
number = 1; |
||||
} |
||||
String numFormat = String.format("%04d", number); |
||||
String taskNo = "R" + date + numFormat; |
||||
inspectionTasks.setTaskNo(taskNo); |
||||
return R.status(inspectionTasksService.saveOrUpdate(inspectionTasks)); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* 删除 巡检任务 |
||||
*/ |
||||
@PostMapping("/remove") |
||||
@ApiOperationSupport(order = 7) |
||||
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
||||
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return R.status(inspectionTasksService.deleteLogic(Func.toLongList(ids))); |
||||
} |
||||
|
||||
/** |
||||
* 启动 巡检任务 |
||||
*/ |
||||
@PostMapping("/action") |
||||
@ApiOperationSupport(order = 8) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R auditing(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve("1",ids); |
||||
} |
||||
|
||||
/** |
||||
* 停止 巡检任务 |
||||
*/ |
||||
@PostMapping("/stop") |
||||
@ApiOperationSupport(order = 9) |
||||
@ApiOperation(value = "更新", notes = "传入ids") |
||||
public R reject(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
||||
return this.approve("2",ids); |
||||
} |
||||
|
||||
/** |
||||
* 启动OR停止 巡检任务 |
||||
*/ |
||||
public R approve(String status, String ids) { |
||||
List<InspectionTasks> list = new ArrayList<>(); |
||||
for (String id : ids.split(",")) { |
||||
InspectionTasks inspectionTasks = new InspectionTasks(); |
||||
inspectionTasks.setId(Long.parseLong(id)); |
||||
inspectionTasks.setTaskStatus(Long.parseLong(status)); |
||||
list.add(inspectionTasks); |
||||
} |
||||
return R.status(inspectionTasksService.updateBatchById(list)); |
||||
} |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
@SneakyThrows |
||||
@GetMapping("export") |
||||
@ApiOperationSupport(order = 10) |
||||
@ApiOperation(value = "导出", notes = "传入") |
||||
@ApiLog |
||||
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
||||
if (entity.containsKey("station_equal")) { |
||||
entity.put("station_equal", Integer.parseInt((String) entity.get("station_equal"))); |
||||
} |
||||
if (entity.containsKey("taskStatus_equal")) { |
||||
entity.put("taskStatus_equal", Integer.parseInt((String) entity.get("taskStatus_equal"))); |
||||
} |
||||
QueryWrapper<InspectionTasks> queryWrapper = Condition.getQueryWrapper(entity, InspectionTasks.class); |
||||
queryWrapper.lambda().eq(InspectionTasks::getIsDeleted, DafConstant.DB_NOT_DELETED); |
||||
List<InspectionTasksExcel> list = inspectionTasksService.export(queryWrapper); |
||||
response.setContentType("application/vnd.ms-excel"); |
||||
response.setCharacterEncoding(Charsets.UTF_8.name()); |
||||
String fileName = URLEncoder.encode("巡检任务数据导出", Charsets.UTF_8.name()); |
||||
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
||||
EasyExcel.write(response.getOutputStream(), InspectionTasksExcel.class).sheet("巡检任务").doWrite(list); |
||||
} |
||||
|
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.inspection.dto; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionResult; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 巡检结果数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class InspectionResultDTO extends InspectionResult { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.inspection.dto; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionRoute; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 巡检路线数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class InspectionRouteDTO extends InspectionRoute { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,18 @@ |
||||
package org.energy.modules.inspection.dto; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionTasks; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
|
||||
/** |
||||
* 巡检任务数据传输对象实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
public class InspectionTasksDTO extends InspectionTasks { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,76 @@ |
||||
package org.energy.modules.inspection.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import java.io.Serializable; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* 巡检结果实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-11 |
||||
*/ |
||||
@Data |
||||
@TableName("i_inspection_result") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionResult对象", description = "巡检结果") |
||||
public class InspectionResult extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 结果编码 |
||||
*/ |
||||
@ApiModelProperty(value = "结果编码") |
||||
private String resultNo; |
||||
/** |
||||
* 巡检任务主键 |
||||
*/ |
||||
@ApiModelProperty(value = "巡检任务主键") |
||||
private Long inspectionRaskId; |
||||
/** |
||||
* 任务执行开始时间 |
||||
*/ |
||||
@ApiModelProperty(value = "任务执行开始时间") |
||||
private String executeStartDate; |
||||
/** |
||||
* 发生原因 |
||||
*/ |
||||
@ApiModelProperty(value = "发生原因") |
||||
private String happenReason; |
||||
/** |
||||
* 任务执行结束时间 |
||||
*/ |
||||
@ApiModelProperty(value = "任务执行结束时间") |
||||
private String executeEndDate; |
||||
/** |
||||
* 巡检结果 |
||||
*/ |
||||
@ApiModelProperty(value = "巡检结果") |
||||
private String inspectiontResult; |
||||
/** |
||||
* 处理过程描述 |
||||
*/ |
||||
@ApiModelProperty(value = "处理过程描述") |
||||
private String processDescription; |
||||
/** |
||||
* 巡检报告 |
||||
*/ |
||||
@ApiModelProperty(value = "巡检报告") |
||||
private String inspectionReport; |
||||
|
||||
|
||||
} |
@ -0,0 +1,71 @@ |
||||
package org.energy.modules.inspection.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import java.io.Serializable; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* 巡检路线实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@TableName("i_inspection_route") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionRoute对象", description = "巡检路线") |
||||
public class InspectionRoute extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 路线编号 |
||||
*/ |
||||
@ApiModelProperty(value = "路线编号") |
||||
private String routeNo; |
||||
/** |
||||
* 路线名称 |
||||
*/ |
||||
@ApiModelProperty(value = "路线名称") |
||||
private String routeName; |
||||
/** |
||||
* 场站 |
||||
*/ |
||||
@ApiModelProperty(value = "场站") |
||||
private Integer stations; |
||||
/** |
||||
* 类型 |
||||
*/ |
||||
@ApiModelProperty(value = "类型") |
||||
private String type; |
||||
/** |
||||
* 巡检状态 |
||||
*/ |
||||
@ApiModelProperty(value = "巡检状态") |
||||
private Integer istatus; |
||||
/** |
||||
* 维护工厂 |
||||
*/ |
||||
@ApiModelProperty(value = "维护工厂") |
||||
private String factory; |
||||
/** |
||||
* 取消原因 |
||||
*/ |
||||
@ApiModelProperty(value = "取消原因") |
||||
private String cancelReason; |
||||
|
||||
|
||||
} |
@ -0,0 +1,121 @@ |
||||
package org.energy.modules.inspection.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.dayu.daf.core.mp.base.BaseEntity; |
||||
import java.io.Serializable; |
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
|
||||
/** |
||||
* 巡检任务实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@TableName("i_inspection_tasks") |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionTasks对象", description = "巡检任务") |
||||
public class InspectionTasks extends BaseEntity { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** |
||||
* 主键 |
||||
*/ |
||||
@JsonSerialize(using = ToStringSerializer.class) |
||||
@ApiModelProperty(value = "主键") |
||||
private Long id; |
||||
/** |
||||
* 任务编码 |
||||
*/ |
||||
@ApiModelProperty(value = "任务编码") |
||||
private String taskNo; |
||||
/** |
||||
* 巡检对象主键 |
||||
*/ |
||||
@ApiModelProperty(value = "巡检对象主键") |
||||
private Long inspectionObjId; |
||||
/** |
||||
* 巡检路线主键 |
||||
*/ |
||||
@ApiModelProperty(value = "巡检路线主键") |
||||
private Long inspectionRouteId; |
||||
/** |
||||
* 巡检计划主键 |
||||
*/ |
||||
@ApiModelProperty(value = "巡检计划主键") |
||||
private Long inspectionPlanId; |
||||
/** |
||||
* 任务名称 |
||||
*/ |
||||
@ApiModelProperty(value = "任务名称") |
||||
private String taskName; |
||||
/** |
||||
* 场站 |
||||
*/ |
||||
@ApiModelProperty(value = "场站") |
||||
private Long station; |
||||
/** |
||||
* 责任人 |
||||
*/ |
||||
@ApiModelProperty(value = "责任人") |
||||
private String responsiblePerson; |
||||
/** |
||||
* 任务生成日期时间 |
||||
*/ |
||||
@ApiModelProperty(value = "任务生成日期时间") |
||||
private String taskStartDate; |
||||
/** |
||||
* 任务结束日期时间 |
||||
*/ |
||||
@ApiModelProperty(value = "任务结束日期时间") |
||||
private String taskEndDate; |
||||
/** |
||||
* 取消原因 |
||||
*/ |
||||
@ApiModelProperty(value = "取消原因") |
||||
private String cancelReason; |
||||
/** |
||||
* 任务状态 |
||||
*/ |
||||
@ApiModelProperty(value = "任务状态") |
||||
private Long taskStatus; |
||||
/** |
||||
* 对象名称 |
||||
*/ |
||||
@ApiModelProperty(value = "对象名称") |
||||
private String objectName; |
||||
/** |
||||
* 对象类型 |
||||
*/ |
||||
@ApiModelProperty(value = "对象类型") |
||||
private String objectType; |
||||
/** |
||||
* 路线名称 |
||||
*/ |
||||
@ApiModelProperty(value = "路线名称") |
||||
private String routeName; |
||||
/** |
||||
* 路线类型 |
||||
*/ |
||||
@ApiModelProperty(value = "路线类型") |
||||
private String routeType; |
||||
/** |
||||
* 计划名称 |
||||
*/ |
||||
@ApiModelProperty(value = "计划名称") |
||||
private String planName; |
||||
/** |
||||
* 计划类型 |
||||
*/ |
||||
@ApiModelProperty(value = "计划类型") |
||||
private String planType; |
||||
|
||||
|
||||
} |
@ -0,0 +1,65 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.inspection.excel; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* EquipmentLedge model export |
||||
* @author edwong |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(16) |
||||
public class InspectionRouteExcel implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "路线编号") |
||||
private String routeNo; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "路线名称") |
||||
private String routeName; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "场站") |
||||
private String stationsName; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "类型") |
||||
private String type; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "巡检状态") |
||||
private String istatusName; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "维护工厂") |
||||
private String factory; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "取消原因") |
||||
private String cancelReason; |
||||
|
||||
} |
@ -0,0 +1,70 @@ |
||||
/** |
||||
* Copyright (c) 2018-2028, Chill Zhuang 庄骞 (smallchill@163.com). |
||||
* <p> |
||||
* Licensed under the Apache License, Version 2.0 (the "License"); |
||||
* you may not use this file except in compliance with the License. |
||||
* You may obtain a copy of the License at |
||||
* <p> |
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
* <p> |
||||
* Unless required by applicable law or agreed to in writing, software |
||||
* distributed under the License is distributed on an "AS IS" BASIS, |
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
||||
* See the License for the specific language governing permissions and |
||||
* limitations under the License. |
||||
*/ |
||||
package org.energy.modules.inspection.excel; |
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty; |
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight; |
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* EquipmentLedge model export |
||||
* @author edwong |
||||
*/ |
||||
@Data |
||||
@ColumnWidth(25) |
||||
@HeadRowHeight(20) |
||||
@ContentRowHeight(16) |
||||
public class InspectionTasksExcel implements Serializable { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ColumnWidth(20) |
||||
@ExcelProperty(value = "任务编号") |
||||
private String taskNo; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "任务名称") |
||||
private String taskName; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "场站") |
||||
private String stationExt; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "任务生成日期") |
||||
private String taskStartDate; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "任务完成日期") |
||||
private String taskEndDate; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "责任人") |
||||
private String responsiblePerson; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "状态") |
||||
private String taskStatusExt; |
||||
|
||||
@ColumnWidth(15) |
||||
@ExcelProperty(value = "取消原因") |
||||
private String cancelReason; |
||||
|
||||
|
||||
} |
@ -0,0 +1,26 @@ |
||||
package org.energy.modules.inspection.mapper; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionResult; |
||||
import org.energy.modules.inspection.vo.InspectionResultVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 巡检结果 Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-11 |
||||
*/ |
||||
public interface InspectionResultMapper extends BaseMapper<InspectionResult> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionResult |
||||
* @return |
||||
*/ |
||||
List<InspectionResultVO> selectInspectionResultPage(IPage page, InspectionResultVO inspectionResult); |
||||
|
||||
} |
@ -0,0 +1,29 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.energy.modules.inspection.mapper.InspectionResultMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="inspectionResultResultMap" type="org.energy.modules.inspection.entity.InspectionResult"> |
||||
<id column="id" property="id"/> |
||||
<result column="status" property="status"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="result_no" property="resultNo"/> |
||||
<result column="inspection_rask_id" property="inspectionRaskId"/> |
||||
<result column="execute_start_date" property="executeStartDate"/> |
||||
<result column="happen_reason" property="happenReason"/> |
||||
<result column="execute_end_date" property="executeEndDate"/> |
||||
<result column="inspectiont_result" property="inspectiontResult"/> |
||||
<result column="process_description" property="processDescription"/> |
||||
<result column="inspection_report" property="inspectionReport"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectInspectionResultPage" resultMap="inspectionResultResultMap"> |
||||
select * from i_inspection_result where is_deleted = 0 |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,42 @@ |
||||
package org.energy.modules.inspection.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.energy.modules.inspection.entity.InspectionRoute; |
||||
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
||||
import org.energy.modules.inspection.vo.InspectionRouteVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.system.entity.Dict; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 巡检路线 Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
public interface InspectionRouteMapper extends BaseMapper<InspectionRoute> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionRoute |
||||
* @return |
||||
*/ |
||||
List<InspectionRouteVO> selectInspectionRoutePage(IPage page, InspectionRouteVO inspectionRoute); |
||||
|
||||
List<InspectionRouteExcel> exportData(@Param("ew") Wrapper<InspectionRoute> queryWrapper); |
||||
|
||||
/** |
||||
* 获取路线编号 |
||||
*/ |
||||
List<InspectionRoute> getRouteList(); |
||||
|
||||
/** |
||||
* 获取最大编号 |
||||
*/ |
||||
String getMaxNo(String date); |
||||
} |
@ -0,0 +1,54 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.energy.modules.inspection.mapper.InspectionRouteMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="inspectionRouteResultMap" type="org.energy.modules.inspection.entity.InspectionRoute"> |
||||
<id column="id" property="id"/> |
||||
<result column="status" property="status"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="route_no" property="routeNo"/> |
||||
<result column="route_name" property="routeName"/> |
||||
<result column="stations" property="stations"/> |
||||
<result column="type" property="type"/> |
||||
<result column="istatus" property="istatus"/> |
||||
<result column="factory" property="factory"/> |
||||
<result column="cancel_reason" property="cancelReason"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectInspectionRoutePage" resultMap="inspectionRouteResultMap"> |
||||
select * from i_inspection_route where is_deleted = 0 |
||||
</select> |
||||
|
||||
<select id="exportData" resultType="org.energy.modules.inspection.excel.InspectionRouteExcel"> |
||||
SELECT route_no, route_name, type, factory, cancel_reason |
||||
,CASE |
||||
WHEN stations = '1' THEN '景和光伏' |
||||
WHEN stations = '2' THEN '北沙一光伏' |
||||
WHEN stations = '3' THEN '北沙二光伏' |
||||
WHEN stations = '4' THEN '达坂城风电一场' |
||||
ELSE '' |
||||
END AS stations_name |
||||
,CASE |
||||
WHEN istatus = '1' THEN '已生效' |
||||
WHEN istatus = '0' THEN '未生效' |
||||
ELSE '' |
||||
END AS istatus_name |
||||
FROM i_inspection_route ${ew.customSqlSegment} |
||||
</select> |
||||
|
||||
<select id="getRouteList" resultMap="inspectionRouteResultMap"> |
||||
select route_no, route_name, type from i_inspection_route where is_deleted = 0 |
||||
</select> |
||||
|
||||
<select id="getMaxNo" resultType="java.lang.String"> |
||||
SELECT max(route_no) |
||||
FROM i_inspection_route where route_no like ${date} |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,42 @@ |
||||
package org.energy.modules.inspection.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
import org.energy.modules.inspection.entity.InspectionTasks; |
||||
import org.energy.modules.inspection.excel.InspectionTasksExcel; |
||||
import org.energy.modules.inspection.vo.InspectionTasksVO; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.leger.entity.EquipmentLedger; |
||||
import org.energy.modules.leger.excel.EquipmentLedgerExcel; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 巡检任务 Mapper 接口 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
public interface InspectionTasksMapper extends BaseMapper<InspectionTasks> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionTasks |
||||
* @return |
||||
*/ |
||||
List<InspectionTasksVO> selectInspectionTasksPage(IPage page, InspectionTasksVO inspectionTasks); |
||||
|
||||
/** |
||||
* 导出 |
||||
*/ |
||||
List<InspectionTasksExcel> exportData(@Param("ew") Wrapper<InspectionTasks> queryWrapper); |
||||
|
||||
/** |
||||
* 获取最大任务编号 |
||||
*/ |
||||
String getMaxTaskNO(String date); |
||||
|
||||
} |
@ -0,0 +1,65 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
<mapper namespace="org.energy.modules.inspection.mapper.InspectionTasksMapper"> |
||||
|
||||
<!-- 通用查询映射结果 --> |
||||
<resultMap id="inspectionTasksResultMap" type="org.energy.modules.inspection.entity.InspectionTasks"> |
||||
<id column="id" property="id"/> |
||||
<result column="status" property="status"/> |
||||
<result column="create_time" property="createTime"/> |
||||
<result column="create_user" property="createUser"/> |
||||
<result column="update_time" property="updateTime"/> |
||||
<result column="update_user" property="updateUser"/> |
||||
<result column="is_deleted" property="isDeleted"/> |
||||
<result column="task_no" property="taskNo"/> |
||||
<result column="inspection_obj_id" property="inspectionObjId"/> |
||||
<result column="inspection_route_id" property="inspectionRouteId"/> |
||||
<result column="inspection_plan_id" property="inspectionPlanId"/> |
||||
<result column="task_name" property="taskName"/> |
||||
<result column="station" property="station"/> |
||||
<result column="responsible_person" property="responsiblePerson"/> |
||||
<result column="task_start_date" property="taskStartDate"/> |
||||
<result column="task_end_date" property="taskEndDate"/> |
||||
<result column="cancel_reason" property="cancelReason"/> |
||||
<result column="task_status" property="taskStatus"/> |
||||
<result column="object_name" property="objectName"/> |
||||
<result column="object_type" property="objectType"/> |
||||
<result column="route_name" property="routeName"/> |
||||
<result column="route_type" property="routeType"/> |
||||
<result column="plan_name" property="planName"/> |
||||
<result column="plan_type" property="planType"/> |
||||
</resultMap> |
||||
|
||||
|
||||
<select id="selectInspectionTasksPage" resultMap="inspectionTasksResultMap"> |
||||
select * from i_inspection_tasks where is_deleted = 0 |
||||
</select> |
||||
|
||||
<select id="exportData" resultType="org.energy.modules.inspection.excel.InspectionTasksExcel"> |
||||
SELECT task_no |
||||
,task_name |
||||
,CASE |
||||
WHEN station = '1' THEN '景和光伏' |
||||
WHEN station = '2' THEN '北沙一光伏' |
||||
WHEN station = '3' THEN '北沙二光伏' |
||||
WHEN station = '4' THEN '达坂城风电一场' |
||||
ELSE '' |
||||
END AS station_ext |
||||
,task_start_date |
||||
,task_end_date |
||||
,responsible_person |
||||
,CASE |
||||
WHEN task_status = '1' THEN '已启动' |
||||
WHEN task_status = '2' THEN '已停止' |
||||
ELSE '' |
||||
END AS task_status_ext |
||||
, cancel_reason |
||||
FROM i_inspection_tasks ${ew.customSqlSegment} |
||||
</select> |
||||
|
||||
<select id="getMaxTaskNO" resultType="java.lang.String"> |
||||
SELECT max(task_no) |
||||
FROM i_inspection_tasks where task_no like ${date} |
||||
</select> |
||||
|
||||
</mapper> |
@ -0,0 +1,25 @@ |
||||
package org.energy.modules.inspection.service; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionResult; |
||||
import org.energy.modules.inspection.vo.InspectionResultVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
/** |
||||
* 巡检结果 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
public interface IInspectionResultService extends BaseService<InspectionResult> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionResult |
||||
* @return |
||||
*/ |
||||
IPage<InspectionResultVO> selectInspectionResultPage(IPage<InspectionResultVO> page, InspectionResultVO inspectionResult); |
||||
|
||||
} |
@ -0,0 +1,48 @@ |
||||
package org.energy.modules.inspection.service; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionRoute; |
||||
import org.energy.modules.inspection.vo.InspectionRouteVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 巡检路线 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
public interface IInspectionRouteService extends BaseService<InspectionRoute> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionRoute |
||||
* @return |
||||
*/ |
||||
IPage<InspectionRouteVO> selectInspectionRoutePage(IPage<InspectionRouteVO> page, InspectionRouteVO inspectionRoute); |
||||
|
||||
/** |
||||
* 获取导出数据 |
||||
* |
||||
* @param queryWrapper |
||||
* @return |
||||
*/ |
||||
List<InspectionRouteExcel> export(Wrapper<InspectionRoute> queryWrapper); |
||||
|
||||
/** |
||||
* 获取路线编号 |
||||
*/ |
||||
List<InspectionRoute> getRouteList(); |
||||
|
||||
/** |
||||
* 获取最大任务编号 |
||||
* |
||||
* @param date |
||||
*/ |
||||
String getMaxNo(String date); |
||||
} |
@ -0,0 +1,46 @@ |
||||
package org.energy.modules.inspection.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import org.energy.modules.inspection.entity.InspectionTasks; |
||||
import org.energy.modules.inspection.excel.InspectionTasksExcel; |
||||
import org.energy.modules.inspection.vo.InspectionTasksVO; |
||||
import com.dayu.daf.core.mp.base.BaseService; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import org.energy.modules.leger.entity.EquipmentLedger; |
||||
import org.energy.modules.leger.excel.EquipmentLedgerExcel; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 巡检任务 服务类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
public interface IInspectionTasksService extends BaseService<InspectionTasks> { |
||||
|
||||
/** |
||||
* 自定义分页 |
||||
* |
||||
* @param page |
||||
* @param inspectionTasks |
||||
* @return |
||||
*/ |
||||
IPage<InspectionTasksVO> selectInspectionTasksPage(IPage<InspectionTasksVO> page, InspectionTasksVO inspectionTasks); |
||||
|
||||
/** |
||||
* 获取导出数据 |
||||
* |
||||
* @param queryWrapper |
||||
* @return |
||||
*/ |
||||
List<InspectionTasksExcel> export(Wrapper<InspectionTasks> queryWrapper); |
||||
|
||||
/** |
||||
* 获取最大任务编号 |
||||
* |
||||
* @param date |
||||
*/ |
||||
String getMaxTaskNo(String date); |
||||
|
||||
} |
@ -0,0 +1,25 @@ |
||||
package org.energy.modules.inspection.service.impl; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionResult; |
||||
import org.energy.modules.inspection.vo.InspectionResultVO; |
||||
import org.energy.modules.inspection.mapper.InspectionResultMapper; |
||||
import org.energy.modules.inspection.service.IInspectionResultService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
/** |
||||
* 巡检结果 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Service |
||||
public class InspectionResultServiceImpl extends BaseServiceImpl<InspectionResultMapper, InspectionResult> implements IInspectionResultService { |
||||
|
||||
@Override |
||||
public IPage<InspectionResultVO> selectInspectionResultPage(IPage<InspectionResultVO> page, InspectionResultVO inspectionResult) { |
||||
return page.setRecords(baseMapper.selectInspectionResultPage(page, inspectionResult)); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,47 @@ |
||||
package org.energy.modules.inspection.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import org.energy.modules.inspection.entity.InspectionRoute; |
||||
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
||||
import org.energy.modules.inspection.vo.InspectionRouteVO; |
||||
import org.energy.modules.inspection.mapper.InspectionRouteMapper; |
||||
import org.energy.modules.inspection.service.IInspectionRouteService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 巡检路线 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Service |
||||
public class InspectionRouteServiceImpl extends BaseServiceImpl<InspectionRouteMapper, InspectionRoute> implements IInspectionRouteService { |
||||
|
||||
@Override |
||||
public IPage<InspectionRouteVO> selectInspectionRoutePage(IPage<InspectionRouteVO> page, InspectionRouteVO inspectionRoute) { |
||||
return page.setRecords(baseMapper.selectInspectionRoutePage(page, inspectionRoute)); |
||||
} |
||||
|
||||
@Override |
||||
public List<InspectionRouteExcel> export(Wrapper<InspectionRoute> queryWrapper) { |
||||
List<InspectionRouteExcel> list = baseMapper.exportData(queryWrapper); |
||||
return list; |
||||
} |
||||
|
||||
@Override |
||||
public List<InspectionRoute> getRouteList() { |
||||
List<InspectionRoute> list = baseMapper.getRouteList(); |
||||
return list; |
||||
} |
||||
|
||||
@Override |
||||
public String getMaxNo(String date){ |
||||
String maxNo = baseMapper.getMaxNo(date); |
||||
return maxNo; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,48 @@ |
||||
package org.energy.modules.inspection.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
import org.energy.modules.inspection.entity.InspectionTasks; |
||||
import org.energy.modules.inspection.excel.InspectionTasksExcel; |
||||
import org.energy.modules.inspection.vo.InspectionTasksVO; |
||||
import org.energy.modules.inspection.mapper.InspectionTasksMapper; |
||||
import org.energy.modules.inspection.service.IInspectionTasksService; |
||||
import com.dayu.daf.core.mp.base.BaseServiceImpl; |
||||
import org.energy.modules.leger.entity.EquipmentLedger; |
||||
import org.energy.modules.leger.excel.EquipmentLedgerExcel; |
||||
import org.springframework.stereotype.Service; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 巡检任务 服务实现类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Service |
||||
public class InspectionTasksServiceImpl extends BaseServiceImpl<InspectionTasksMapper, InspectionTasks> implements IInspectionTasksService { |
||||
|
||||
@Override |
||||
public IPage<InspectionTasksVO> selectInspectionTasksPage(IPage<InspectionTasksVO> page, InspectionTasksVO inspectionTasks) { |
||||
return page.setRecords(baseMapper.selectInspectionTasksPage(page, inspectionTasks)); |
||||
} |
||||
|
||||
@Override |
||||
public List<InspectionTasksExcel> export(Wrapper<InspectionTasks> queryWrapper) { |
||||
List<InspectionTasksExcel> list = baseMapper.exportData(queryWrapper); |
||||
return list; |
||||
} |
||||
|
||||
/** |
||||
* 获取最大任务编号 |
||||
* |
||||
* @param date |
||||
*/ |
||||
@Override |
||||
public String getMaxTaskNo(String date){ |
||||
String maxTakNo = baseMapper.getMaxTaskNO(date); |
||||
return maxTakNo; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.inspection.vo; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionResult; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* 巡检结果视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionResultVO对象", description = "巡检结果") |
||||
public class InspectionResultVO extends InspectionResult { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.inspection.vo; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionRoute; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* 巡检路线视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionRouteVO对象", description = "巡检路线") |
||||
public class InspectionRouteVO extends InspectionRoute { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
@ -0,0 +1,20 @@ |
||||
package org.energy.modules.inspection.vo; |
||||
|
||||
import org.energy.modules.inspection.entity.InspectionTasks; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import io.swagger.annotations.ApiModel; |
||||
|
||||
/** |
||||
* 巡检任务视图实体类 |
||||
* |
||||
* @author Daf |
||||
* @since 2024-07-10 |
||||
*/ |
||||
@Data |
||||
@EqualsAndHashCode(callSuper = true) |
||||
@ApiModel(value = "InspectionTasksVO对象", description = "巡检任务") |
||||
public class InspectionTasksVO extends InspectionTasks { |
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
} |
Loading…
Reference in new issue