fix:期间核查、检定校准细节调整
This commit is contained in:
@@ -214,6 +214,14 @@ public class DeviceCalibrationServiceImpl implements DeviceCalibrationService, B
|
||||
ruleParam.put("businessType", DeviceConstant.CALIBRATION_TYPE);
|
||||
ruleParam.put("deviceId", deviceId);
|
||||
List<DeviceInfoWithBizConfigVO> deviceList = deviceInfomationService.getListNeedByRule(ruleParam);
|
||||
if(deviceList.isEmpty()){
|
||||
throw exception0(DEVICE_CALIBRATION_NOT_EXISTS.getCode(), "当前设备未配置检定校准规则,请配置后再操作");
|
||||
}
|
||||
DeviceInfoWithBizConfigVO configVO = deviceList.get(0);
|
||||
DeviceConfigBusinessRuleDO rule = configVO.getRule();
|
||||
if(rule == null){
|
||||
throw exception0(DEVICE_CALIBRATION_NOT_EXISTS.getCode(), "当前设备未配置检定校准规则,请配置后再操作");
|
||||
}
|
||||
String formKey = dictionaryBusinessService.getValueByDataKey(formDicKey);
|
||||
DataTemplateDO formTemplate = dataTemplateService.getLatestDataByKey(formKey);
|
||||
Long formTemplateId = formTemplate.getId();
|
||||
@@ -223,16 +231,8 @@ public class DeviceCalibrationServiceImpl implements DeviceCalibrationService, B
|
||||
entity.setEffectiveFlag("1");
|
||||
entity.setFormId(formTemplateId);
|
||||
entity.setFlowStatus(QmsCommonConstant.NOT_START);
|
||||
if(deviceList.isEmpty()){
|
||||
deviceCalibrationMapper.insert(entity);
|
||||
return BeanUtils.toBean(entity, DeviceCalibrationRespVO.class);
|
||||
}
|
||||
DeviceInfoWithBizConfigVO configVO = deviceList.get(0);
|
||||
DeviceConfigBusinessRuleDO rule = configVO.getRule();
|
||||
if(rule == null){
|
||||
deviceCalibrationMapper.insert(entity);
|
||||
return BeanUtils.toBean(entity, DeviceCalibrationRespVO.class);
|
||||
}
|
||||
|
||||
|
||||
entity.setSpecification(rule.getStandard());
|
||||
entity.setCheckType(rule.getCalibrationCheckType());
|
||||
entity.setFrequencyRemark(rule.getFrequencyRemark());
|
||||
|
||||
@@ -272,6 +272,14 @@ public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService, B
|
||||
ruleParam.put("businessType", DeviceConstant.PERIOD_TYPE);
|
||||
ruleParam.put("deviceId", deviceId);
|
||||
List<DeviceInfoWithBizConfigVO> deviceList = deviceInfomationService.getListNeedByRule(ruleParam);
|
||||
if(deviceList.isEmpty()){
|
||||
throw exception0(DEVICE_PERIOD_CHECK_NOT_EXISTS.getCode(), "当前设备未配置期间核查规则,请配置后再操作");
|
||||
}
|
||||
DeviceInfoWithBizConfigVO configVO = deviceList.get(0);
|
||||
DeviceConfigBusinessRuleDO rule = configVO.getRule();
|
||||
if(rule == null){
|
||||
throw exception0(DEVICE_PERIOD_CHECK_NOT_EXISTS.getCode(), "当前设备未配置期间核查规则,请配置后再操作");
|
||||
}
|
||||
String formKey = dictionaryBusinessService.getValueByDataKey(formDicKey);
|
||||
DataTemplateDO formTemplate = dataTemplateService.getLatestDataByKey(formKey);
|
||||
Long formTemplateId = formTemplate.getId();
|
||||
@@ -282,16 +290,7 @@ public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService, B
|
||||
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);
|
||||
}
|
||||
DeviceInfoWithBizConfigVO configVO = deviceList.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());
|
||||
@@ -309,7 +308,14 @@ public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService, B
|
||||
ruleParam.put("businessType", DeviceConstant.PERIOD_TYPE);
|
||||
ruleParam.put("deviceId", deviceId);
|
||||
List<MaterialInfoWithBizConfigVO> materialList = materialInfomationService.getListNeedByRule(ruleParam);
|
||||
|
||||
if(materialList.isEmpty()){
|
||||
throw exception0(DEVICE_PERIOD_CHECK_NOT_EXISTS.getCode(), "当前物料未配置期间核查规则,请配置后再操作");
|
||||
}
|
||||
MaterialInfoWithBizConfigVO configVO = materialList.get(0);
|
||||
DeviceConfigBusinessRuleDO rule = configVO.getRule();
|
||||
if(rule == null){
|
||||
throw exception0(DEVICE_PERIOD_CHECK_NOT_EXISTS.getCode(), "当前物料未配置期间核查规则,请配置后再操作");
|
||||
}
|
||||
String formKey = dictionaryBusinessService.getValueByDataKey(formDicKey);
|
||||
DataTemplateDO formTemplate = dataTemplateService.getLatestDataByKey(formKey);
|
||||
Long formTemplateId = formTemplate.getId();
|
||||
@@ -320,16 +326,6 @@ public class DevicePeriodCheckServiceImpl implements DevicePeriodCheckService, B
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user