Bladeren bron

优化代码

xiewenjie 3 jaren geleden
bovenliggende
commit
f8e147721c
1 gewijzigde bestanden met toevoegingen van 5 en 5 verwijderingen
  1. 5 5
      sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ManagerController.java

+ 5 - 5
sxz-core/src/main/java/com/fdkk/sxz/webApi/controller/ManagerController.java

@@ -430,12 +430,12 @@ public class ManagerController extends BaseController {
                     responseRenovationPartsDetailManager.setTypeName(renovationPartsEntity.getDescription() + " > " + renovationPartsTypeEntity.getDescription());
                 }
             }
-
-            RenovationPartsColorEntity renovationPartsColorEntity = renovationPartsColorService.findById(renovationPartsDetailEntity.getPartsColorId());
-            if (renovationPartsColorEntity != null) {
-                responseRenovationPartsDetailManager.setColorName(renovationPartsColorEntity.getColorName());
+            if (ObjectUtil.isNotNull(renovationPartsDetailEntity.getPartsColorId())) {
+                RenovationPartsColorEntity renovationPartsColorEntity = renovationPartsColorService.findById(renovationPartsDetailEntity.getPartsColorId());
+                if (renovationPartsColorEntity != null) {
+                    responseRenovationPartsDetailManager.setColorName(renovationPartsColorEntity.getColorName());
+                }
             }
-
             ResponseRenovationPartsAttaching responseRenovationPartsAttaching = renovationPartsAttachingService.findAttachinByDetailId(renovationPartsDetailEntity.getId());
             if (responseRenovationPartsAttaching != null) {
                 if (responseRenovationPartsAttaching.isWallAttaching()) {