fix:期间核查、检定校准细节调整
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
||||
import com.zt.plat.module.qms.resource.device.service.DeviceCalibrationPlanService;
|
||||
import com.zt.plat.module.qms.resource.device.service.DeviceProductService;
|
||||
@@ -65,7 +67,7 @@ public class DeviceCalibrationController extends AbstractFileUploadController im
|
||||
}
|
||||
|
||||
@PostMapping("/createByDeviceId")
|
||||
@Operation(summary = "创建设备-检定校准")
|
||||
@Operation(summary = "创建检定校准")
|
||||
public CommonResult<DeviceCalibrationRespVO> createByDeviceId(@RequestBody DeviceCalibrationSaveReqVO createReqVO) {
|
||||
return success(deviceCalibrationService.createByDeviceId(createReqVO));
|
||||
}
|
||||
@@ -111,6 +113,20 @@ public class DeviceCalibrationController extends AbstractFileUploadController im
|
||||
return success(vo);
|
||||
}
|
||||
|
||||
@GetMapping("/getLastData")
|
||||
@Operation(summary = "获得设备-检定校准")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<DeviceCalibrationVO> getLastData(@Valid DeviceCalibrationPageReqVO vo) {
|
||||
Long deviceId = vo.getDeviceId();
|
||||
if(ObjectUtils.isEmpty(deviceId)){
|
||||
return CommonResult.error(0, "缺少参数");
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("deviceId", deviceId);
|
||||
param.put("flowStatus", QmsCommonConstant.COMPLETED);
|
||||
return CommonResult.success(deviceCalibrationService.getLastData( param));
|
||||
}
|
||||
|
||||
@RequestMapping("/submitApply")
|
||||
@Operation(summary = "提交申请")
|
||||
public CommonResult<DeviceCalibrationRespVO> submitApply(@RequestBody DeviceCalibrationSaveReqVO param) {
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zt.plat.module.qms.enums.QmsCommonConstant;
|
||||
import com.zt.plat.module.qms.resource.device.common.DeviceConstant;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.*;
|
||||
import com.zt.plat.module.qms.resource.device.service.DeviceProductService;
|
||||
@@ -66,6 +68,18 @@ public class DevicePeriodCheckController extends AbstractFileUploadController im
|
||||
return success(devicePeriodCheckService.createDevicePeriodCheck(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/createByDeviceId")
|
||||
@Operation(summary = "创建期间核查-设备")
|
||||
public CommonResult<DevicePeriodCheckRespVO> createByDeviceId(@RequestBody DevicePeriodCheckSaveReqVO createReqVO) {
|
||||
return success(devicePeriodCheckService.createByDeviceId(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/createByMaterialId")
|
||||
@Operation(summary = "创建期间核查-物料试剂")
|
||||
public CommonResult<DevicePeriodCheckRespVO> createByMaterialId(@RequestBody DevicePeriodCheckSaveReqVO createReqVO) {
|
||||
return success(devicePeriodCheckService.createByMaterialId(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备-期间核查")
|
||||
public CommonResult<DevicePeriodCheckRespVO> updateDevicePeriodCheck(@Valid @RequestBody DevicePeriodCheckSaveReqVO updateReqVO) {
|
||||
@@ -148,7 +162,7 @@ public class DevicePeriodCheckController extends AbstractFileUploadController im
|
||||
Page<DevicePeriodCheckPageReqVO> page = new Page<>(param.getPageNo(), param.getPageSize());
|
||||
Long productId = param.getProductId();
|
||||
if(!ObjectUtils.isEmpty(productId)){
|
||||
List<Long> productIdList = deviceProductService.getIdListByIdPath(productId);
|
||||
List<Long> productIdList = materialProductService.getIdListByIdPath(productId);
|
||||
param.setProductIdList(productIdList);
|
||||
param.setProductId(null);
|
||||
}
|
||||
@@ -163,6 +177,34 @@ public class DevicePeriodCheckController extends AbstractFileUploadController im
|
||||
return CommonResult.success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/getLastDataDevice")
|
||||
@Operation(summary = "获取指定设备最新期间核查数据")
|
||||
public CommonResult<DevicePeriodCheckVO> getLastDataDevice(@Valid DevicePeriodCheckPageReqVO vo) {
|
||||
Long deviceId = vo.getDeviceId();
|
||||
if(ObjectUtils.isEmpty(deviceId)){
|
||||
return CommonResult.error(0, "缺少参数");
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("deviceId", deviceId);
|
||||
param.put("flowStatus", QmsCommonConstant.COMPLETED);
|
||||
param.put("checkTarget", DeviceConstant.PERIOD_CHECK_TAGET_DEVICE);
|
||||
return CommonResult.success(devicePeriodCheckService.getLastDataDevice( param));
|
||||
}
|
||||
|
||||
@GetMapping("/getLastDataMaterial")
|
||||
@Operation(summary = "获取指定物料最新期间核查数据")
|
||||
public CommonResult<DevicePeriodCheckVO> getLastDataMaterial(@Valid DevicePeriodCheckPageReqVO vo) {
|
||||
Long deviceId = vo.getDeviceId();
|
||||
if(ObjectUtils.isEmpty(deviceId)){
|
||||
return CommonResult.error(0, "缺少参数");
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("deviceId", deviceId);
|
||||
param.put("flowStatus", QmsCommonConstant.COMPLETED);
|
||||
param.put("checkTarget", DeviceConstant.PERIOD_CHECK_TAGET_MATERIAL);
|
||||
return CommonResult.success(devicePeriodCheckService.getLastDataMaterial( param));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备-期间核查 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-period-check:export')")
|
||||
|
||||
@@ -49,7 +49,7 @@ public interface DeviceCalibrationMapper extends BaseMapperX<DeviceCalibrationDO
|
||||
.eqIfPresent(DeviceCalibrationDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(DeviceCalibrationDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DeviceCalibrationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceCalibrationDO::getId));
|
||||
.orderByDesc(DeviceCalibrationDO::getCreateTime));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -57,6 +57,9 @@ public interface DeviceCalibrationMapper extends BaseMapperX<DeviceCalibrationDO
|
||||
* */
|
||||
List<DeviceCalibrationVO> getLastDataCheckList(@Param("param") JSONObject param);
|
||||
|
||||
DeviceCalibrationVO getLastData(@Param("param") JSONObject param);
|
||||
|
||||
|
||||
IPage<DeviceCalibrationVO> queryPageList(Page<DeviceCalibrationPageReqVO> page, @Param("param") DeviceCalibrationPageReqVO param);
|
||||
|
||||
}
|
||||
@@ -30,7 +30,7 @@ public interface DeviceCalibrationPlanMapper extends BaseMapperX<DeviceCalibrati
|
||||
.eqIfPresent(DeviceCalibrationPlanDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(DeviceCalibrationPlanDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DeviceCalibrationPlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceCalibrationPlanDO::getId));
|
||||
.orderByDesc(DeviceCalibrationPlanDO::getCreateTime));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,7 +47,7 @@ public interface DevicePeriodCheckMapper extends BaseMapperX<DevicePeriodCheckDO
|
||||
.eqIfPresent(DevicePeriodCheckDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(DevicePeriodCheckDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DevicePeriodCheckDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DevicePeriodCheckDO::getId));
|
||||
.orderByDesc(DevicePeriodCheckDO::getCreateTime));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -58,4 +58,7 @@ public interface DevicePeriodCheckMapper extends BaseMapperX<DevicePeriodCheckDO
|
||||
IPage<DevicePeriodCheckVO> queryPageListDevice(Page<DevicePeriodCheckPageReqVO> page, @Param("param") DevicePeriodCheckPageReqVO param);
|
||||
|
||||
IPage<DevicePeriodCheckVO> queryPageListMaterial(Page<DevicePeriodCheckPageReqVO> page, @Param("param") DevicePeriodCheckPageReqVO param);
|
||||
|
||||
DevicePeriodCheckVO getLastDataDevice(@Param("param") JSONObject param);
|
||||
DevicePeriodCheckVO getLastDataMaterial(@Param("param") JSONObject param);
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public interface DevicePeriodCheckPlanMapper extends BaseMapperX<DevicePeriodChe
|
||||
.eqIfPresent(DevicePeriodCheckPlanDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(DevicePeriodCheckPlanDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DevicePeriodCheckPlanDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DevicePeriodCheckPlanDO::getId));
|
||||
.orderByDesc(DevicePeriodCheckPlanDO::getCreateTime));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.CommonResult;
|
||||
@@ -70,6 +71,7 @@ public interface DeviceCalibrationService {
|
||||
*/
|
||||
DeviceCalibrationDO getDeviceCalibration(Long id);
|
||||
DeviceCalibrationVO getDeviceCalibrationVO(Long id);
|
||||
DeviceCalibrationVO getLastData(JSONObject param);
|
||||
|
||||
/**
|
||||
* 获得设备-检定校准分页
|
||||
|
||||
@@ -388,4 +388,9 @@ public class DeviceCalibrationServiceImpl implements DeviceCalibrationService, B
|
||||
JSONObject ret = new JSONObject();
|
||||
return CommonResult.success(ret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceCalibrationVO getLastData(JSONObject param) {
|
||||
return deviceCalibrationMapper.getLastData(param);
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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.CommonResult;
|
||||
@@ -44,6 +45,8 @@ public interface DevicePeriodCheckService {
|
||||
|
||||
DevicePeriodCheckRespVO createByDeviceId(DevicePeriodCheckSaveReqVO createReqVO);
|
||||
|
||||
DevicePeriodCheckRespVO createByMaterialId(DevicePeriodCheckSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备-期间核查
|
||||
*
|
||||
@@ -75,6 +78,8 @@ public interface DevicePeriodCheckService {
|
||||
|
||||
DevicePeriodCheckVO getVoDevice(Long id);
|
||||
DevicePeriodCheckVO getVoMaterial(Long id);
|
||||
DevicePeriodCheckVO getLastDataMaterial(JSONObject param);
|
||||
DevicePeriodCheckVO getLastDataDevice(JSONObject param);
|
||||
/**
|
||||
* 获得设备-期间核查分页
|
||||
*
|
||||
|
||||
@@ -281,6 +281,7 @@ public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService, B
|
||||
entity.setEffectiveFlag("1");
|
||||
entity.setFormId(formTemplateId);
|
||||
entity.setFlowStatus(QmsCommonConstant.NOT_START);
|
||||
entity.setCheckTarget(DeviceConstant.PERIOD_CHECK_TAGET_DEVICE);
|
||||
if(deviceList.isEmpty()){
|
||||
devicePeriodCheckMapper.insert(entity);
|
||||
return BeanUtils.toBean(entity, DevicePeriodCheckRespVO.class);
|
||||
@@ -292,6 +293,47 @@ public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService, B
|
||||
return BeanUtils.toBean(entity, DevicePeriodCheckRespVO.class);
|
||||
}
|
||||
entity.setFrequencyRemark(rule.getFrequencyRemark());
|
||||
entity.setCheckPersonRemark(rule.getTreatmentUser());
|
||||
entity.setCheckAccording(rule.getTreatmentMethod());
|
||||
entity.setFrequencyRemark(rule.getFrequencyRemark());
|
||||
devicePeriodCheckMapper.insert(entity);
|
||||
return BeanUtils.toBean(entity, DevicePeriodCheckRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevicePeriodCheckRespVO createByMaterialId(DevicePeriodCheckSaveReqVO createReqVO) {
|
||||
Long deviceId = createReqVO.getDeviceId();
|
||||
if(deviceId == null)
|
||||
throw exception0(DEVICE_PERIOD_CHECK_NOT_EXISTS.getCode(), "请选择设备或标准物质");
|
||||
JSONObject ruleParam = new JSONObject();
|
||||
ruleParam.put("businessType", DeviceConstant.PERIOD_TYPE);
|
||||
ruleParam.put("deviceId", deviceId);
|
||||
List<MaterialInfoWithBizConfigVO> materialList = materialInfomationService.getListNeedByRule(ruleParam);
|
||||
|
||||
String formKey = dictionaryBusinessService.getValueByDataKey(formDicKey);
|
||||
DataTemplateDO formTemplate = dataTemplateService.getLatestDataByKey(formKey);
|
||||
Long formTemplateId = formTemplate.getId();
|
||||
DevicePeriodCheckDO entity = new DevicePeriodCheckDO();
|
||||
entity.setDeviceId(deviceId);
|
||||
entity.setPlanId(0L);
|
||||
entity.setEffectiveFlag("1");
|
||||
entity.setFormId(formTemplateId);
|
||||
entity.setFlowStatus(QmsCommonConstant.NOT_START);
|
||||
entity.setCheckTarget(DeviceConstant.PERIOD_CHECK_TAGET_MATERIAL);
|
||||
if(materialList.isEmpty()){
|
||||
devicePeriodCheckMapper.insert(entity);
|
||||
return BeanUtils.toBean(entity, DevicePeriodCheckRespVO.class);
|
||||
}
|
||||
MaterialInfoWithBizConfigVO configVO = materialList.get(0);
|
||||
DeviceConfigBusinessRuleDO rule = configVO.getRule();
|
||||
if(rule == null){
|
||||
devicePeriodCheckMapper.insert(entity);
|
||||
return BeanUtils.toBean(entity, DevicePeriodCheckRespVO.class);
|
||||
}
|
||||
entity.setFrequencyRemark(rule.getFrequencyRemark());
|
||||
entity.setCheckPersonRemark(rule.getTreatmentUser());
|
||||
entity.setCheckAccording(rule.getTreatmentMethod());
|
||||
entity.setFrequencyRemark(rule.getFrequencyRemark());
|
||||
devicePeriodCheckMapper.insert(entity);
|
||||
return BeanUtils.toBean(entity, DevicePeriodCheckRespVO.class);
|
||||
}
|
||||
@@ -428,4 +470,14 @@ public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService, B
|
||||
JSONObject ret = new JSONObject();
|
||||
return CommonResult.success(ret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevicePeriodCheckVO getLastDataMaterial(JSONObject param) {
|
||||
return devicePeriodCheckMapper.getLastDataMaterial(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevicePeriodCheckVO getLastDataDevice(JSONObject param) {
|
||||
return devicePeriodCheckMapper.getLastDataDevice(param);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user