Procházet zdrojové kódy

试验系统样品处理

lvy před 1 měsícem
rodič
revize
a471817867

+ 11 - 1
blade-service/blade-business/src/main/java/org/springblade/business/controller/EntrustInfoController.java

@@ -18,6 +18,7 @@ package org.springblade.business.controller;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.*;
 import lombok.AllArgsConstructor;
@@ -120,7 +121,16 @@ public class  EntrustInfoController extends BladeController {
 	@ApiOperation(value = "修改", notes = "传入entrustInfo")
 	@Transactional
 	public R update(@Valid @RequestBody EntrustInfo entrustInfo) {
-			// rfid--绑定 需要判断 委托单的状态和创建情况
+		EntrustInfo info = entrustInfoService.getById(entrustInfo.getId());
+		if (info ==  null) {
+			// 前端样品处理页面传递的是样品id
+			List<EntrustInfo> list = entrustInfoService.list(Wrappers.<EntrustInfo>lambdaQuery().eq(EntrustInfo::getSampleId, entrustInfo.getId()));
+			if (list == null || list.isEmpty()) {
+				return R.fail("委托单不存在");
+			}
+			entrustInfo.setId(list.get(0).getId());
+		}
+		// rfid--绑定 需要判断 委托单的状态和创建情况
 			if(Func.isNotEmpty(entrustInfo.getRepealType()) && entrustInfo.getRepealType()==1){
 				entrustInfo.setSampleStatus("6");
 				entrustInfo.setRepealTime(new Date());