diff --git a/src/main/java/com/spring/modules/test/controller/TestInformationController.java b/src/main/java/com/spring/modules/test/controller/TestInformationController.java index d7057872..e9e2428b 100644 --- a/src/main/java/com/spring/modules/test/controller/TestInformationController.java +++ b/src/main/java/com/spring/modules/test/controller/TestInformationController.java @@ -295,4 +295,18 @@ public class TestInformationController { TestInformationEntity row = testInformationService.getTestRemarkEntry(data); return R.ok().put("row", row); } + + /** + * @description: 更新测试主信息的材料总金额 + * @author: AI Assistant + * @date: 2025/11/18 + * @param: [data] + * @return: com.spring.common.utils.R + **/ + @PostMapping(value="/updateMaterialTotalAmount") + @ResponseBody + public R updateMaterialTotalAmount(@RequestBody TestInformationVo data) { + testInformationService.updateMaterialTotalAmount(data); + return R.ok("更新成功"); + } } diff --git a/src/main/java/com/spring/modules/test/service/TestInformationService.java b/src/main/java/com/spring/modules/test/service/TestInformationService.java index d61bf502..e0ad50ca 100644 --- a/src/main/java/com/spring/modules/test/service/TestInformationService.java +++ b/src/main/java/com/spring/modules/test/service/TestInformationService.java @@ -58,4 +58,6 @@ public interface TestInformationService extends IService void testInfoEditEntry(TestInformationVo data); TestInformationEntity getTestRemarkEntry(TestInformationVo data); + + void updateMaterialTotalAmount(TestInformationVo data); } diff --git a/src/main/java/com/spring/modules/test/service/impl/TestInformationServiceImpl.java b/src/main/java/com/spring/modules/test/service/impl/TestInformationServiceImpl.java index e9668c91..9b342af9 100644 --- a/src/main/java/com/spring/modules/test/service/impl/TestInformationServiceImpl.java +++ b/src/main/java/com/spring/modules/test/service/impl/TestInformationServiceImpl.java @@ -202,6 +202,19 @@ public class TestInformationServiceImpl extends ServiceImpl updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("test_no", data.getTestNo()) + .set("material_total_amount", data.getMaterialTotalAmount()); + testInformationMapper.update(null, updateWrapper); + } + /** * 下达 * @param data