瀏覽代碼

bug处理

LAPTOP-FO2T5SIU\35838 9 月之前
父節點
當前提交
01b6a19529
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      pro-base/src/main/java/com/idea/buildManage/service/ParkFloorDiscService.java

+ 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;