package org.jeecg.modules.eam.controller;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import lombok.extern.slf4j.Slf4j;
|
import org.jeecg.common.api.vo.Result;
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
import org.jeecg.common.system.base.controller.JeecgController;
|
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.modules.eam.entity.SpecialtyInspectionPlanDetail;
|
import org.jeecg.modules.eam.service.ISpecialtyInspectionPlanDetailService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.servlet.ModelAndView;
|
|
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletResponse;
|
import java.util.Arrays;
|
import java.util.Map;
|
|
/**
|
* @Description: mom_eam_specialty_inspection_plan_detail
|
* @Author: jeecg-boot
|
* @Date: 2023-04-19
|
* @Version: V1.0
|
*/
|
@Api(tags="mom_eam_specialty_inspection_plan_detail")
|
@RestController
|
@RequestMapping("/eam/specialtyInspectionPlanDetail")
|
@Slf4j
|
public class SpecialtyInspectionPlanDetailController extends JeecgController<SpecialtyInspectionPlanDetail, ISpecialtyInspectionPlanDetailService> {
|
@Autowired
|
private ISpecialtyInspectionPlanDetailService specialtyInspectionPlanDetailService;
|
|
// @Autowired
|
// private IUploadRelaService uploadRelaService;
|
//
|
// @Autowired
|
// private IUploadService uploadService;
|
|
/**
|
* 分页列表查询
|
*
|
* @param specialtyInspectionPlanDetail
|
* @param pageNo
|
* @param pageSize
|
* @param req
|
* @return
|
*/
|
//@AutoLog(value = "mom_eam_specialty_inspection_plan_detail-分页列表查询")
|
@ApiOperation(value="mom_eam_specialty_inspection_plan_detail-分页列表查询", notes="mom_eam_specialty_inspection_plan_detail-分页列表查询")
|
@GetMapping(value = "/list")
|
public Result<IPage<SpecialtyInspectionPlanDetail>> queryPageList(SpecialtyInspectionPlanDetail specialtyInspectionPlanDetail,
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
HttpServletRequest req) {
|
QueryWrapper<SpecialtyInspectionPlanDetail> queryWrapper = QueryGenerator.initQueryWrapper(specialtyInspectionPlanDetail, req.getParameterMap());
|
Page<SpecialtyInspectionPlanDetail> page = new Page<SpecialtyInspectionPlanDetail>(pageNo, pageSize);
|
IPage<SpecialtyInspectionPlanDetail> pageList = specialtyInspectionPlanDetailService.page(page, queryWrapper);
|
return Result.OK(pageList);
|
}
|
|
/**
|
* 日常点检项目明细
|
* qsw 2023-4-26
|
*/
|
@GetMapping("/getSpecialtyInspectionPlanDetails")
|
public Result<?> getSpecialtyInspectionPlanDetails(@RequestParam("pageNo") Integer pageNo,
|
@RequestParam("pageSize") Integer pageSize,
|
@RequestParam Map<String, Object> params) {
|
|
IPage<Map<String, Object>> specialtyInspectionPlanDetails = specialtyInspectionPlanDetailService.getSpecialtyInspectionPlanDetailById(pageNo, pageSize, params);
|
// for (Map<String, Object> record : specialtyInspectionPlanDetails.getRecords()) {
|
// //获取是否有无异常照片数据
|
// List<SysUploadRela> sysUploadRelas = uploadRelaService.lambdaQuery().eq(SysUploadRela::getBusId, (String)record.get("id")).eq(SysUploadRela::getDelFlag, 0).list();
|
// if(sysUploadRelas.size()>0){
|
// record.put("isNoPhotoFlag",true);
|
// List<SysUploadRela> uploadRelas = uploadRelaService.listByBusIdAndBusType((String)record.get("id"), "daily_inspection_standard_photo");
|
// SysUpload upload = new SysUpload();
|
// if (CollectionUtils.isNotEmpty(uploadRelas)) {
|
// upload = uploadService.getById(uploadRelas.get(0).getUploadId());
|
// }
|
// record.put("upload",upload);
|
// }else{
|
// record.put("isNoPhotoFlag",false);
|
// SysUpload upload = new SysUpload();
|
// record.put("upload",upload);
|
// }
|
// }
|
return Result.ok(specialtyInspectionPlanDetails);
|
}
|
|
/**
|
* 添加
|
*
|
* @param specialtyInspectionPlanDetail
|
* @return
|
*/
|
@AutoLog(value = "mom_eam_specialty_inspection_plan_detail-添加")
|
@ApiOperation(value="mom_eam_specialty_inspection_plan_detail-添加", notes="mom_eam_specialty_inspection_plan_detail-添加")
|
//@RequiresPermissions("org.jeecg.modules.demo:mom_eam_specialty_inspection_plan_detail:add")
|
@PostMapping(value = "/add")
|
public Result<String> add(@RequestBody SpecialtyInspectionPlanDetail specialtyInspectionPlanDetail) {
|
specialtyInspectionPlanDetailService.save(specialtyInspectionPlanDetail);
|
return Result.OK("添加成功!");
|
}
|
|
/**
|
* 编辑
|
*
|
* @param specialtyInspectionPlanDetail
|
* @return
|
*/
|
@AutoLog(value = "mom_eam_specialty_inspection_plan_detail-编辑")
|
@ApiOperation(value="mom_eam_specialty_inspection_plan_detail-编辑", notes="mom_eam_specialty_inspection_plan_detail-编辑")
|
//@RequiresPermissions("org.jeecg.modules.demo:mom_eam_specialty_inspection_plan_detail:edit")
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
public Result<String> edit(@RequestBody SpecialtyInspectionPlanDetail specialtyInspectionPlanDetail) {
|
specialtyInspectionPlanDetailService.updateById(specialtyInspectionPlanDetail);
|
return Result.OK("编辑成功!");
|
}
|
|
/**
|
* 通过id删除
|
*
|
* @param id
|
* @return
|
*/
|
@AutoLog(value = "mom_eam_specialty_inspection_plan_detail-通过id删除")
|
@ApiOperation(value="mom_eam_specialty_inspection_plan_detail-通过id删除", notes="mom_eam_specialty_inspection_plan_detail-通过id删除")
|
//@RequiresPermissions("org.jeecg.modules.demo:mom_eam_specialty_inspection_plan_detail:delete")
|
@DeleteMapping(value = "/delete")
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
SpecialtyInspectionPlanDetail specialtyInspectionPlanDetail = specialtyInspectionPlanDetailService.getById(id);
|
specialtyInspectionPlanDetail.setDelFlag(1);
|
specialtyInspectionPlanDetailService.updateById(specialtyInspectionPlanDetail);
|
return Result.OK("删除成功!");
|
}
|
|
/**
|
* 批量删除
|
*
|
* @param ids
|
* @return
|
*/
|
@AutoLog(value = "mom_eam_specialty_inspection_plan_detail-批量删除")
|
@ApiOperation(value="mom_eam_specialty_inspection_plan_detail-批量删除", notes="mom_eam_specialty_inspection_plan_detail-批量删除")
|
//@RequiresPermissions("org.jeecg.modules.demo:mom_eam_specialty_inspection_plan_detail:deleteBatch")
|
@DeleteMapping(value = "/deleteBatch")
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
this.specialtyInspectionPlanDetailService.removeByIds(Arrays.asList(ids.split(",")));
|
return Result.OK("批量删除成功!");
|
}
|
|
/**
|
* 通过id查询
|
*
|
* @param id
|
* @return
|
*/
|
//@AutoLog(value = "mom_eam_specialty_inspection_plan_detail-通过id查询")
|
@ApiOperation(value="mom_eam_specialty_inspection_plan_detail-通过id查询", notes="mom_eam_specialty_inspection_plan_detail-通过id查询")
|
@GetMapping(value = "/queryById")
|
public Result<SpecialtyInspectionPlanDetail> queryById(@RequestParam(name="id",required=true) String id) {
|
SpecialtyInspectionPlanDetail specialtyInspectionPlanDetail = specialtyInspectionPlanDetailService.getById(id);
|
if(specialtyInspectionPlanDetail==null) {
|
return Result.error("未找到对应数据");
|
}
|
return Result.OK(specialtyInspectionPlanDetail);
|
}
|
|
/**
|
* 导出excel
|
*
|
* @param request
|
* @param specialtyInspectionPlanDetail
|
*/
|
//@RequiresPermissions("org.jeecg.modules.demo:mom_eam_specialty_inspection_plan_detail:exportXls")
|
@RequestMapping(value = "/exportXls")
|
public ModelAndView exportXls(HttpServletRequest request, SpecialtyInspectionPlanDetail specialtyInspectionPlanDetail) {
|
return super.exportXls(request, specialtyInspectionPlanDetail, SpecialtyInspectionPlanDetail.class, "mom_eam_specialty_inspection_plan_detail");
|
}
|
|
/**
|
* 通过excel导入数据
|
*
|
* @param request
|
* @param response
|
* @return
|
*/
|
//@RequiresPermissions("mom_eam_specialty_inspection_plan_detail:importExcel")
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
return super.importExcel(request, response, SpecialtyInspectionPlanDetail.class);
|
}
|
|
}
|