diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java index 2fe63c5..904b4c4 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/controller/admin/AutoIngredientsController.java @@ -46,7 +46,7 @@ public class AutoIngredientsController { @PostMapping("/submit-assay-result") @Operation(summary = "检测结果同步") public CommonResult submitAssayResult(@RequestBody AutoIngredientsTaskAssayResultReqVO body) { - System.out.println(com.alibaba.fastjson2.JSON.toJSONString(body)); +// System.out.println(com.alibaba.fastjson2.JSON.toJSONString(body)); autoIngredientsService.submitAssayResult(body); return CommonResult.success("成功"); } diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java index 3e5f8f3..48f2685 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/thirdpartyapi/service/AutoIngredientsServiceImpl.java @@ -1,9 +1,11 @@ package com.zt.plat.module.qms.thirdpartyapi.service; +import java.lang.reflect.Field; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import org.apache.commons.lang3.StringUtils; @@ -43,6 +45,7 @@ import com.zt.plat.module.qms.thirdpartyapi.controller.vo.AutoIngredientsTaskRes import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.ReflectUtil; import jakarta.annotation.Resource; @Service @@ -194,7 +197,15 @@ public class AutoIngredientsServiceImpl implements AutoIngredientsService { if (configSubSampleMethodConfItem.getRequired()) { ConfigSubSampleMethodConfPoint source = configSubSampleMethodConfItem.getSource(); String field = source.getField(); +// System.out.println("field:" + field); +// Field field2 = ReflectUtil.getField(autoIngredientsTaskDetailAssayResultReqVO.getClass(), field); +// Map fieldMap = ReflectUtil.getFieldMap(autoIngredientsTaskDetailAssayResultReqVO.getClass()); +// Object fieldValue2 = ReflectUtil.getFieldValue(autoIngredientsTaskDetailAssayResultReqVO, fieldMap.get(field)); Object fieldValue = BeanUtil.getFieldValue(autoIngredientsTaskDetailAssayResultReqVO, field); + if (fieldValue == null) { + fieldValue = ""; + } +// System.out.println("fieldValue:" + fieldValue); ConfigSubSampleMethodConfPoint target = configSubSampleMethodConfItem.getTarget(); String project = target.getProject();