LAPTOP-FO2T5SIU\35838 месяцев назад: 9
Родитель
Сommit
01b6a19529

+ 7 - 2
pro-base/src/main/java/com/idea/buildManage/service/ParkFloorDiscService.java

@@ -15,7 +15,9 @@ import com.rockstar.frame.model.extend.DateTrans;
 import com.rockstar.frame.model.extend.Tablepar;
 import com.rockstar.shiro.util.ShiroUtils;
 import com.rockstar.util.SnowflakeIdWorker;
+import com.rockstar.util.StringUtils;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.poi.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -187,9 +189,12 @@ public class ParkFloorDiscService implements BaseService<ParkFloorDisc, ParkFloo
         String houseTypeStr = model.getHouseTypeStr();
         List<HouseType> houseTypes = JSONObject.parseArray(houseTypeStr, HouseType.class);
         for(HouseType houseType : houseTypes){
-            houseType.setId(IdUtil.simpleUUID());
+            // 没有id的情况
+            if(StringUtils.isEmpty(houseType.getId())){
+                houseType.setId(IdUtil.simpleUUID());
+            }
             houseType.setDiscId(model.getId());
-            houseTypeService.insertSelective(houseType);
+            houseTypeService.insertWithoutId(houseType);
         }
         int result = updateByPrimaryKeySelective(model);
         return result;