xiongchao há 3 anos atrás
pai
commit
96bc49a63a

+ 12 - 0
platform-rest/src/main/java/com/platform/rest/controller/sb/SbInfoController.java

@@ -8,6 +8,7 @@ import com.platform.common.validation.group.UpdateGroup;
 import com.platform.dao.dto.part.PartInfoDTO;
 import com.platform.dao.dto.repair.RepairProjectRelationDTO;
 import com.platform.dao.dto.sb.SbInfoDTO;
+import com.platform.dao.entity.sb.SbInfo;
 import com.platform.dao.util.ExcelUtil;
 import com.platform.dao.util.TreeUtil;
 import com.platform.dao.vo.export.sb.ExportSbInfoVO;
@@ -51,6 +52,17 @@ public class SbInfoController {
         return new R<>(sbInfoService.getById(id));
     }
 
+    /**
+     * 通过id查询单条记录
+     *
+     * @param sbInfo 主键
+     * @return R
+     */
+    @GetMapping("/model")
+    public R getModelByModel(SbInfo sbInfo) {
+        return new R<>(sbInfoService.getModelByModel(sbInfo));
+    }
+
     /**
      * 新增记录
      *

+ 3 - 0
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -172,6 +172,9 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
     @Override
     @Transactional(rollbackFor = Exception.class)
     public RepairApplicationForm saveModelByDTO(RepairApplicationFormDTO model) {
+        if(StringUtils.isBlank(model.getSbId())){
+            throw new BusinessException("请填写报修设备");
+        }
         Integer type = model.getType();
         if (type == null) {
             type = 1;