|
|
|
@ -3,17 +3,15 @@ package com.hnac.hzims.operational.defect.controller;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.google.common.collect.Lists; |
|
|
|
|
import com.hnac.hzims.common.invalid.DictInvalid; |
|
|
|
|
import com.hnac.hzims.common.invalid.ObjectRequiredInvalid; |
|
|
|
|
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
|
|
|
|
import com.hnac.hzims.common.logs.enums.BusinessType; |
|
|
|
|
import com.hnac.hzims.common.logs.enums.OperatorType; |
|
|
|
|
import com.hnac.hzims.fdp.entity.FdpTaskEntity; |
|
|
|
|
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; |
|
|
|
|
import com.hnac.hzims.operational.defect.entity.OperAppearanceEntity; |
|
|
|
|
import com.hnac.hzims.operational.defect.service.IOperAppearanceService; |
|
|
|
|
import com.hnac.hzims.operational.defect.service.IOperPhenomenonService; |
|
|
|
|
import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; |
|
|
|
|
import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper; |
|
|
|
|
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO; |
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -25,14 +23,10 @@ import org.springblade.core.mp.support.Condition;
|
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.flow.core.entity.BladeFlow; |
|
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 控制器 |
|
|
|
|
* |
|
|
|
@ -45,6 +39,7 @@ import java.util.Date;
|
|
|
|
|
@Validated |
|
|
|
|
public class OperPhenomenonController extends BladeController { |
|
|
|
|
|
|
|
|
|
private final IOperAppearanceService operAppearanceService; |
|
|
|
|
private final IOperPhenomenonService phenomenonService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -54,10 +49,9 @@ public class OperPhenomenonController extends BladeController {
|
|
|
|
|
@GetMapping("/detail") |
|
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
|
@ApiOperation(value = "详情", notes = "传入phenomenon") |
|
|
|
|
public R<OperPhenomenonVO> detail(OperPhenomenonEntity phenomenon) { |
|
|
|
|
OperPhenomenonEntity detail = phenomenonService.getOne(Condition.getQueryWrapper(phenomenon)); |
|
|
|
|
OperPhenomenonVO vo = OperPhenomenonWrapper.build().entityVO(detail); |
|
|
|
|
return R.data(vo); |
|
|
|
|
public R<OperAppearanceEntity> detail(OperAppearanceEntity phenomenon) { |
|
|
|
|
OperAppearanceEntity appearanceEntity = operAppearanceService.getOne(Condition.getQueryWrapper(phenomenon)); |
|
|
|
|
return R.data(appearanceEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -72,58 +66,24 @@ public class OperPhenomenonController extends BladeController {
|
|
|
|
|
@OperationAnnotation(moduleName = "缺陷管理", title = "现象库", operatorType = OperatorType.MOBILE, businessType = |
|
|
|
|
BusinessType.GENCODE, action |
|
|
|
|
= "分页") |
|
|
|
|
public R<IPage<OperPhenomenonVO>> list(OperPhenomenonEntity entity, String taskIds, Query query, Date findTimeEnd) { |
|
|
|
|
LambdaQueryWrapper<OperPhenomenonEntity> queryWrapper = Condition.getQueryWrapper(new OperPhenomenonEntity(), entity); |
|
|
|
|
if (StringUtil.isNotBlank(taskIds)) { |
|
|
|
|
queryWrapper.in(OperPhenomenonEntity::getId, Lists.newArrayList(taskIds.split(","))); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(entity.getFindTime())) { |
|
|
|
|
queryWrapper.ge(OperPhenomenonEntity::getFindTime, entity.getFindTime()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(findTimeEnd)) { |
|
|
|
|
queryWrapper.le(OperPhenomenonEntity::getFindTime, findTimeEnd); |
|
|
|
|
public R<IPage<OperAppearanceEntity>> list(OperAppearanceVO phenomenon, Query query) { |
|
|
|
|
LambdaQueryWrapper<OperAppearanceEntity> queryWrapper = operAppearanceService.getQueryWrapper(phenomenon); |
|
|
|
|
IPage<OperAppearanceEntity> pages = operAppearanceService.page(Condition.getPage(query), queryWrapper); |
|
|
|
|
// IPage<OperPhenomenonVO> vos = OperPhenomenonWrapper.build().pageVO(pages);
|
|
|
|
|
return R.data(pages); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(entity.getDiscriminateStatus())) { |
|
|
|
|
queryWrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, entity.getDiscriminateStatus()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(entity.getCreateDept())) { |
|
|
|
|
queryWrapper.eq(OperPhenomenonEntity::getCreateDept, entity.getCreateDept()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// // 区域Id
|
|
|
|
|
// if (Func.isNotEmpty(entity.getAreaId())) {
|
|
|
|
|
// queryWrapper.eq(OperPhenomenonEntity::getCreateDept, entity.getAreaId());
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// // 年份
|
|
|
|
|
// if (Func.isNotEmpty(entity.getYearMonth())) {
|
|
|
|
|
// queryWrapper.apply("date_format(t.CREATE_TIME, '%Y-%m') = '"
|
|
|
|
|
// + (entity.getYearMonth() + "'"));
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// // 是否为缺陷 已定论1
|
|
|
|
|
// if (Func.isNotEmpty(entity.getDefect()) && Func.isNotEmpty(entity.getConclusionStatusNum())) {
|
|
|
|
|
// queryWrapper.eq(OperPhenomenonEntity::getIsDefect, entity.getDefect());
|
|
|
|
|
// queryWrapper.or().eq(OperPhenomenonEntity::getConclusionStatus, entity.getConclusionStatusNum());
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
queryWrapper.orderByDesc(OperPhenomenonEntity::getUpdateTime); |
|
|
|
|
IPage<OperPhenomenonEntity> pages = phenomenonService.page(Condition.getPage(query), queryWrapper); |
|
|
|
|
IPage<OperPhenomenonVO> vos = OperPhenomenonWrapper.build().pageVO(pages); |
|
|
|
|
return R.data(vos); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 新增 代码自定义代号 |
|
|
|
|
*/ |
|
|
|
|
@PostMapping("/save") |
|
|
|
|
@ApiOperationSupport(order = 4) |
|
|
|
|
@ApiOperation(value = "提交现象,现象提交后不能修改", notes = "传入phenomenon") |
|
|
|
|
public R save(@Valid @RequestBody OperPhenomenonEntity phenomenon) { |
|
|
|
|
return R.data(phenomenonService.submit(phenomenon)); |
|
|
|
|
} |
|
|
|
|
//此端口弃用20230621
|
|
|
|
|
// /**
|
|
|
|
|
// * 新增 代码自定义代号
|
|
|
|
|
// */
|
|
|
|
|
// @PostMapping("/save")
|
|
|
|
|
// @ApiOperationSupport(order = 4)
|
|
|
|
|
// @ApiOperation(value = "提交现象,现象提交后不能修改", notes = "传入phenomenon")
|
|
|
|
|
// public R save(@Valid @RequestBody OperPhenomenonEntity phenomenon) {
|
|
|
|
|
// return R.data(phenomenonService.submit(phenomenon));
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
/* */ /** |
|
|
|
|
* 修改 代码自定义代号 |
|
|
|
@ -153,7 +113,7 @@ public class OperPhenomenonController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
|
|
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
|
|
|
|
return R.status(phenomenonService.deleteLogic(Func.toLongList(ids))); |
|
|
|
|
return R.status(operAppearanceService.deleteLogic(Func.toLongList(ids))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|