|
|
@ -3,17 +3,15 @@ package com.hnac.hzims.operational.defect.controller; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
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.invalid.ObjectRequiredInvalid; |
|
|
|
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
|
|
|
import com.hnac.hzims.common.logs.annotation.OperationAnnotation; |
|
|
|
import com.hnac.hzims.common.logs.enums.BusinessType; |
|
|
|
import com.hnac.hzims.common.logs.enums.BusinessType; |
|
|
|
import com.hnac.hzims.common.logs.enums.OperatorType; |
|
|
|
import com.hnac.hzims.common.logs.enums.OperatorType; |
|
|
|
import com.hnac.hzims.fdp.entity.FdpTaskEntity; |
|
|
|
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.service.IOperPhenomenonService; |
|
|
|
import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; |
|
|
|
import com.hnac.hzims.operational.defect.vo.OperAppearanceVO; |
|
|
|
import com.hnac.hzims.operational.defect.wrapper.OperPhenomenonWrapper; |
|
|
|
|
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiImplicitParams; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
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.mp.support.Query; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
|
|
|
import org.springblade.flow.core.entity.BladeFlow; |
|
|
|
import org.springblade.flow.core.entity.BladeFlow; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 控制器 |
|
|
|
* 控制器 |
|
|
|
* |
|
|
|
* |
|
|
@ -45,6 +39,7 @@ import java.util.Date; |
|
|
|
@Validated |
|
|
|
@Validated |
|
|
|
public class OperPhenomenonController extends BladeController { |
|
|
|
public class OperPhenomenonController extends BladeController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final IOperAppearanceService operAppearanceService; |
|
|
|
private final IOperPhenomenonService phenomenonService; |
|
|
|
private final IOperPhenomenonService phenomenonService; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -54,10 +49,9 @@ public class OperPhenomenonController extends BladeController { |
|
|
|
@GetMapping("/detail") |
|
|
|
@GetMapping("/detail") |
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
@ApiOperationSupport(order = 1) |
|
|
|
@ApiOperation(value = "详情", notes = "传入phenomenon") |
|
|
|
@ApiOperation(value = "详情", notes = "传入phenomenon") |
|
|
|
public R<OperPhenomenonVO> detail(OperPhenomenonEntity phenomenon) { |
|
|
|
public R<OperAppearanceEntity> detail(OperAppearanceEntity phenomenon) { |
|
|
|
OperPhenomenonEntity detail = phenomenonService.getOne(Condition.getQueryWrapper(phenomenon)); |
|
|
|
OperAppearanceEntity appearanceEntity = operAppearanceService.getOne(Condition.getQueryWrapper(phenomenon)); |
|
|
|
OperPhenomenonVO vo = OperPhenomenonWrapper.build().entityVO(detail); |
|
|
|
return R.data(appearanceEntity); |
|
|
|
return R.data(vo); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -72,58 +66,24 @@ public class OperPhenomenonController extends BladeController { |
|
|
|
@OperationAnnotation(moduleName = "缺陷管理", title = "现象库", operatorType = OperatorType.MOBILE, businessType = |
|
|
|
@OperationAnnotation(moduleName = "缺陷管理", title = "现象库", operatorType = OperatorType.MOBILE, businessType = |
|
|
|
BusinessType.GENCODE, action |
|
|
|
BusinessType.GENCODE, action |
|
|
|
= "分页") |
|
|
|
= "分页") |
|
|
|
public R<IPage<OperPhenomenonVO>> list(OperPhenomenonEntity entity, String taskIds, Query query, Date findTimeEnd) { |
|
|
|
public R<IPage<OperAppearanceEntity>> list(OperAppearanceVO phenomenon, Query query) { |
|
|
|
LambdaQueryWrapper<OperPhenomenonEntity> queryWrapper = Condition.getQueryWrapper(new OperPhenomenonEntity(), entity); |
|
|
|
LambdaQueryWrapper<OperAppearanceEntity> queryWrapper = operAppearanceService.getQueryWrapper(phenomenon); |
|
|
|
if (StringUtil.isNotBlank(taskIds)) { |
|
|
|
IPage<OperAppearanceEntity> pages = operAppearanceService.page(Condition.getPage(query), queryWrapper); |
|
|
|
queryWrapper.in(OperPhenomenonEntity::getId, Lists.newArrayList(taskIds.split(","))); |
|
|
|
// IPage<OperPhenomenonVO> vos = OperPhenomenonWrapper.build().pageVO(pages);
|
|
|
|
} |
|
|
|
return R.data(pages); |
|
|
|
if (Func.isNotEmpty(entity.getFindTime())) { |
|
|
|
|
|
|
|
queryWrapper.ge(OperPhenomenonEntity::getFindTime, entity.getFindTime()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (Func.isNotEmpty(findTimeEnd)) { |
|
|
|
|
|
|
|
queryWrapper.le(OperPhenomenonEntity::getFindTime, findTimeEnd); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//此端口弃用20230621
|
|
|
|
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));
|
|
|
|
*/ |
|
|
|
// }
|
|
|
|
@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) |
|
|
|
@ApiOperationSupport(order = 7) |
|
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
|
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids") |
|
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String 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))); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|