傅行帆 5 years ago
parent
commit
15800770ae

+ 5
- 3
src/main/java/com/huiju/estateagents/service/impl/TaHousingResourcesServiceImpl.java View File

380
                 String floorName = row.getCell(3).getStringCellValue().trim();
380
                 String floorName = row.getCell(3).getStringCellValue().trim();
381
                 String roomName = row.getCell(4).getStringCellValue().trim();
381
                 String roomName = row.getCell(4).getStringCellValue().trim();
382
                 BigDecimal price = BigDecimal.valueOf(row.getCell(5).getNumericCellValue());
382
                 BigDecimal price = BigDecimal.valueOf(row.getCell(5).getNumericCellValue());
383
-                Integer heat = Integer.valueOf((row.getCell(6).getNumericCellValue() + "").substring(0, 1));
383
+                String heatString = String.valueOf(row.getCell(6).getNumericCellValue());
384
+                String split = heatString.substring(0, heatString.indexOf("."));
385
+                Integer heat = Integer.valueOf(split);
384
                 Integer status = row.getCell(7).getStringCellValue().trim().equals("是") ? 1 : 0;
386
                 Integer status = row.getCell(7).getStringCellValue().trim().equals("是") ? 1 : 0;
385
 
387
 
386
                 int currentRow = j + 1;
388
                 int currentRow = j + 1;
408
                 String houseInfo = termName + blockName + unitName + floorName + roomName;
410
                 String houseInfo = termName + blockName + unitName + floorName + roomName;
409
                 if (temHousingList.contains(houseInfo)) {
411
                 if (temHousingList.contains(houseInfo)) {
410
                     logger.info("存在重复房源:{}", houseInfo);
412
                     logger.info("存在重复房源:{}", houseInfo);
411
-                    responseBean.addError("第" + currentRow + "行存在重复房源");
413
+                    responseBean.addError("第" + currentRow + "行存在重复房源,请删除重复房源后再次上传文件。");
412
                     return responseBean;
414
                     return responseBean;
413
                 }
415
                 }
414
 
416
 
425
                 TaHousingResources oldTaHouseingResources = taHousingResourcesMapper.selectOne(taHousingResourcesQueryWrapper);
427
                 TaHousingResources oldTaHouseingResources = taHousingResourcesMapper.selectOne(taHousingResourcesQueryWrapper);
426
                 if (null != oldTaHouseingResources) {
428
                 if (null != oldTaHouseingResources) {
427
                     logger.info("数据库存在重复房源:{}", houseInfo);
429
                     logger.info("数据库存在重复房源:{}", houseInfo);
428
-                    responseBean.addError("第" + currentRow + "行与系统已录入房源" + oldTaHouseingResources.getHouseId() + "重复");
430
+                    responseBean.addError("第" + currentRow + "行与系统已录入房源" + oldTaHouseingResources.getHouseId() + "重复,请删除重复房源后再次上传文件。(注意,要检查本楼盘下所有批次的房源)。");
429
                     return responseBean;
431
                     return responseBean;
430
                 }
432
                 }
431
 
433
 

+ 2
- 2
src/main/resources/mapper/TaHousingResourcesMapper.xml View File

127
         SELECT
127
         SELECT
128
             t.* ,
128
             t.* ,
129
             a.apartment_name,
129
             a.apartment_name,
130
-            u.user_name
130
+            u.user_name as update_name
131
         FROM
131
         FROM
132
             ta_housing_resources t
132
             ta_housing_resources t
133
         LEFT JOIN ta_building_apartment a ON t.apartment_id = a.apartment_id
133
         LEFT JOIN ta_building_apartment a ON t.apartment_id = a.apartment_id
139
         <if test="apartmentId != null and apartmentId != ''">
139
         <if test="apartmentId != null and apartmentId != ''">
140
             AND t.apartment_id = #{apartmentId}
140
             AND t.apartment_id = #{apartmentId}
141
         </if>
141
         </if>
142
-        <if test="status != null and status != ''">
142
+        <if test="status != null">
143
             AND t.status = #{status}
143
             AND t.status = #{status}
144
         </if>
144
         </if>
145
         <if test="houseId != null and houseId != ''">
145
         <if test="houseId != null and houseId != ''">