feat:设备期间核查基础逻辑
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
@@ -55,7 +56,8 @@ public class DeviceCalibrationPlanController extends AbstractFileUploadControlle
|
|||||||
|
|
||||||
@PostMapping("/createPlan")
|
@PostMapping("/createPlan")
|
||||||
@Operation(summary = "创建设备-检定校准计划")
|
@Operation(summary = "创建设备-检定校准计划")
|
||||||
public CommonResult<DeviceCalibrationPlanRespVO> createPlan(String checkYear) {
|
public CommonResult<DeviceCalibrationPlanRespVO> createPlan(@RequestBody JSONObject param) {
|
||||||
|
String checkYear = param.getString("checkYear");
|
||||||
return deviceCalibrationPlanService.createPlan(checkYear);
|
return deviceCalibrationPlanService.createPlan(checkYear);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPageReqVO;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckRespVO;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckSaveReqVO;
|
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
||||||
|
import com.zt.plat.module.qms.resource.device.service.DeviceProductService;
|
||||||
|
import org.springframework.util.ObjectUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -52,8 +54,8 @@ public class DevicePeriodCheckController extends AbstractFileUploadController im
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Resource
|
@Resource private DevicePeriodCheckService devicePeriodCheckService;
|
||||||
private DevicePeriodCheckService devicePeriodCheckService;
|
@Resource private DeviceProductService deviceProductService;
|
||||||
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建设备-期间核查")
|
@Operation(summary = "创建设备-期间核查")
|
||||||
@@ -93,11 +95,38 @@ public class DevicePeriodCheckController extends AbstractFileUploadController im
|
|||||||
return success(BeanUtils.toBean(devicePeriodCheck, DevicePeriodCheckRespVO.class));
|
return success(BeanUtils.toBean(devicePeriodCheck, DevicePeriodCheckRespVO.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/getVO")
|
||||||
|
@Operation(summary = "获得设备-检定校准")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
public CommonResult<DevicePeriodCheckVO> getVO(@RequestParam("id") Long id) {
|
||||||
|
DevicePeriodCheckVO vo = devicePeriodCheckService.getDevicePeriodCheckVO(id);
|
||||||
|
return success(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/submitApply")
|
||||||
|
@Operation(summary = "提交申请")
|
||||||
|
public CommonResult<DevicePeriodCheckRespVO> submitApply(@RequestBody DevicePeriodCheckSaveReqVO param) {
|
||||||
|
return devicePeriodCheckService.submitApply(param);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得设备-期间核查分页")
|
@Operation(summary = "获得设备-期间核查分页")
|
||||||
public CommonResult<PageResult<DevicePeriodCheckRespVO>> getDevicePeriodCheckPage(@Valid DevicePeriodCheckPageReqVO pageReqVO) {
|
public CommonResult<PageResult<DevicePeriodCheckVO>> getDevicePeriodCheckPage(@Valid DevicePeriodCheckPageReqVO param) {
|
||||||
PageResult<DevicePeriodCheckDO> pageResult = devicePeriodCheckService.getDevicePeriodCheckPage(pageReqVO);
|
Page<DevicePeriodCheckPageReqVO> page = new Page<>(param.getPageNo(), param.getPageSize());
|
||||||
return success(BeanUtils.toBean(pageResult, DevicePeriodCheckRespVO.class));
|
Long productId = param.getProductId();
|
||||||
|
if(!ObjectUtils.isEmpty(productId)){
|
||||||
|
List<Long> productIdList = deviceProductService.getIdListByIdPath(productId);
|
||||||
|
param.setProductIdList(productIdList);
|
||||||
|
param.setProductId(null);
|
||||||
|
}
|
||||||
|
String flowStatus = param.getFlowStatus();
|
||||||
|
if (!ObjectUtils.isEmpty(flowStatus)) {
|
||||||
|
param.setFlowStatusList(Arrays.asList(flowStatus.split(",")));
|
||||||
|
param.setFlowStatus("");
|
||||||
|
}
|
||||||
|
IPage<DevicePeriodCheckVO> pageList = devicePeriodCheckService.queryPageList(page, param);
|
||||||
|
PageResult<DevicePeriodCheckVO> pageResult = new PageResult<>(pageList.getRecords(), pageList.getTotal());
|
||||||
|
return CommonResult.success(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
@@ -56,12 +57,22 @@ public class DevicePeriodCheckPlanController extends AbstractFileUploadControlle
|
|||||||
|
|
||||||
@PostMapping("/createPlan")
|
@PostMapping("/createPlan")
|
||||||
@Operation(summary = "创建设备-期间核查计划")
|
@Operation(summary = "创建设备-期间核查计划")
|
||||||
public CommonResult<DevicePeriodCheckPlanRespVO> createDevicePeriodCheckPlan(@RequestBody String checkYear) {
|
public CommonResult<DevicePeriodCheckPlanRespVO> createDevicePeriodCheckPlan(@RequestBody JSONObject param) {
|
||||||
|
String checkYear = param.getString("checkYear");
|
||||||
return success(devicePeriodCheckPlanService.createPlan(checkYear));
|
return success(devicePeriodCheckPlanService.createPlan(checkYear));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/savePlan")
|
||||||
|
@Operation(summary = "编辑计划")
|
||||||
|
public CommonResult<DevicePeriodCheckPlanRespVO> savePlan(@RequestBody DevicePeriodCheckPlanSaveReqVO param) {
|
||||||
|
return devicePeriodCheckPlanService.savePlan(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/submitApply")
|
||||||
|
@Operation(summary = "提交申请")
|
||||||
|
public CommonResult<DevicePeriodCheckPlanRespVO> submitApply(@RequestBody DevicePeriodCheckPlanSaveReqVO param) {
|
||||||
|
return devicePeriodCheckPlanService.submitApply(param);
|
||||||
|
}
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新设备-期间核查计划")
|
@Operation(summary = "更新设备-期间核查计划")
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
|||||||
@Data
|
@Data
|
||||||
public class DevicePeriodCheckPageReqVO extends PageParam {
|
public class DevicePeriodCheckPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "ID")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
@Schema(description = "期间核查计划id", example = "21407")
|
@Schema(description = "期间核查计划id", example = "21407")
|
||||||
private Long planId;
|
private Long planId;
|
||||||
|
|
||||||
@@ -85,4 +88,35 @@ public class DevicePeriodCheckPageReqVO extends PageParam {
|
|||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] createTime;
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
|
||||||
|
//======================设备大类字段==============================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//======================设备字段==============================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//======================查询字段==============================
|
||||||
|
@Schema(description = "流程状态列表")
|
||||||
|
private List<String> flowStatusList;
|
||||||
|
|
||||||
|
@Schema(description = "设备名称")
|
||||||
|
private String deviceName;
|
||||||
|
|
||||||
|
// @Schema(description = "计划id列表")
|
||||||
|
// private List<Long> planIdList;
|
||||||
|
|
||||||
|
@Schema(description = "设备大类id")
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
@Schema(description = "设备大类id列表")
|
||||||
|
private List<Long> productIdList;
|
||||||
|
|
||||||
|
@Schema(description = "部门id列表")
|
||||||
|
private List<Long> deptIdList;
|
||||||
|
|
||||||
|
@Schema(description = "部门id")
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||||
|
|
||||||
|
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceCalibrationDO;
|
||||||
|
import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckDO;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@@ -48,4 +50,7 @@ public class DevicePeriodCheckPlanSaveReqVO {
|
|||||||
@Schema(description = "备注")
|
@Schema(description = "备注")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
//==============扩展字段==================
|
||||||
|
@Schema(description = "检定校准明细列表")
|
||||||
|
List<DevicePeriodCheckDO> devicePeriodCheckList;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 期间核查响应对象
|
||||||
|
* */
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DevicePeriodCheckVO extends DevicePeriodCheckRespVO{
|
||||||
|
|
||||||
|
//=========公共字段============
|
||||||
|
|
||||||
|
private Long companyId;
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
private Long postId;
|
||||||
|
private Long tenantId;
|
||||||
|
|
||||||
|
private String updaterName;
|
||||||
|
private String creatorName;
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
private String creator;
|
||||||
|
private String updater;
|
||||||
|
|
||||||
|
//============大类字段============
|
||||||
|
|
||||||
|
private String specification; //规格
|
||||||
|
|
||||||
|
private String modelNo; //型号
|
||||||
|
|
||||||
|
private String manufacturer; //制造商
|
||||||
|
|
||||||
|
private String customConfig;
|
||||||
|
|
||||||
|
private JSONObject customConfigJson;
|
||||||
|
|
||||||
|
//============设备字段============
|
||||||
|
private String deviceName; //设备名称
|
||||||
|
|
||||||
|
private String alias; //别名
|
||||||
|
|
||||||
|
private String deviceCode; //管理编号
|
||||||
|
|
||||||
|
private String factoryCode; //出厂编号
|
||||||
|
}
|
||||||
@@ -1,13 +1,14 @@
|
|||||||
package com.zt.plat.module.qms.resource.device.dal.mapper;
|
package com.zt.plat.module.qms.resource.device.dal.mapper;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.framework.mybatis.core.query.MPJLambdaWrapperX;
|
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckVO;
|
||||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckDO;
|
import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckDO;
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPageReqVO;
|
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPageReqVO;
|
||||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckPlanDO;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -54,4 +55,5 @@ public interface DevicePeriodCheckMapper extends BaseMapperX<DevicePeriodCheckDO
|
|||||||
* */
|
* */
|
||||||
List<DevicePeriodCheckDO> getLastDataCheckList(@Param("param") JSONObject param);
|
List<DevicePeriodCheckDO> getLastDataCheckList(@Param("param") JSONObject param);
|
||||||
|
|
||||||
|
IPage<DevicePeriodCheckVO> queryPageList(Page<DevicePeriodCheckPageReqVO> page, @Param("param") DevicePeriodCheckPageReqVO param);
|
||||||
}
|
}
|
||||||
@@ -259,7 +259,6 @@ public class DeviceCalibrationPlanServiceImpl implements DeviceCalibrationPlanSe
|
|||||||
//判断是否最后一个节点
|
//判断是否最后一个节点
|
||||||
String lastActivityFlag = "0";
|
String lastActivityFlag = "0";
|
||||||
String firstActivityFlag = "0";
|
String firstActivityFlag = "0";
|
||||||
String borrowConfirm = "0";
|
|
||||||
if(!fieldExtensions.isEmpty()){
|
if(!fieldExtensions.isEmpty()){
|
||||||
for(int i = 0; i < fieldExtensions.size(); i++){
|
for(int i = 0; i < fieldExtensions.size(); i++){
|
||||||
JSONObject fieldExtension = fieldExtensions.getJSONObject(i);
|
JSONObject fieldExtension = fieldExtensions.getJSONObject(i);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,8 @@ package com.zt.plat.module.qms.resource.device.service;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanPageReqVO;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanRespVO;
|
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
||||||
import com.zt.plat.module.qms.resource.device.controller.vo.DevicePeriodCheckPlanSaveReqVO;
|
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckPlanDO;
|
import com.zt.plat.module.qms.resource.device.dal.dataobject.DevicePeriodCheckPlanDO;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
@@ -21,6 +20,9 @@ public interface DevicePeriodCheckPlanService {
|
|||||||
*/
|
*/
|
||||||
DevicePeriodCheckPlanRespVO createPlan(String checkYear);
|
DevicePeriodCheckPlanRespVO createPlan(String checkYear);
|
||||||
|
|
||||||
|
CommonResult<DevicePeriodCheckPlanRespVO> savePlan(DevicePeriodCheckPlanSaveReqVO paramVO);
|
||||||
|
|
||||||
|
CommonResult<DevicePeriodCheckPlanRespVO> submitApply(DevicePeriodCheckPlanSaveReqVO paramVO);
|
||||||
/**
|
/**
|
||||||
* 更新设备-期间核查计划
|
* 更新设备-期间核查计划
|
||||||
*
|
*
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user