|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.ruoyi.benyun.entity.AddrCategory;
|
|
|
import com.ruoyi.benyun.entity.BrandZone;
|
|
|
import com.ruoyi.benyun.mapper.AddrCategoryDao;
|
|
|
+import com.ruoyi.benyun.mapper.BrandDao;
|
|
|
import com.ruoyi.benyun.mapper.BrandZoneDao;
|
|
|
import com.ruoyi.benyun.mapper.StoreDao;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -22,11 +23,12 @@ public class BrandZoneStat {
|
|
|
BrandZoneDao brandZoneDao;
|
|
|
@Autowired
|
|
|
AddrCategoryDao addrCategoryDao;
|
|
|
+ @Autowired
|
|
|
+ BrandDao brandDao;
|
|
|
|
|
|
public void continueQuicklyInsert(){
|
|
|
- List<String> notIns = brandZoneDao.searchStatedBrandIds(null);
|
|
|
- System.out.println("已经处理:" + notIns.size() + "个品牌");
|
|
|
- List<BrandZone> zones = brandZoneDao.searchQuicklyStatistics(notIns);
|
|
|
+ List<String> ins = brandDao.selectAllId();
|
|
|
+ List<BrandZone> zones = brandZoneDao.searchQuicklyStatistics(ins);
|
|
|
int total = zones.size();
|
|
|
int i = 0;
|
|
|
for (BrandZone zone : zones) {
|
|
@@ -36,11 +38,13 @@ public class BrandZoneStat {
|
|
|
QueryWrapper<AddrCategory> queryWrapper = new QueryWrapper<>();
|
|
|
queryWrapper.eq("addr_code",zone.getAddrCode());
|
|
|
AddrCategory one = addrCategoryDao.selectOne(queryWrapper);
|
|
|
- zone.setZone(one.getDistrict());
|
|
|
- zone.setCity(one.getCity());
|
|
|
- zone.setProvince(one.getProvince());
|
|
|
- zone.setLat(one.getLatGd());
|
|
|
- zone.setLng(one.getLngGd());
|
|
|
+ if (one != null){
|
|
|
+ zone.setZone(one.getDistrict());
|
|
|
+ zone.setCity(one.getCity());
|
|
|
+ zone.setProvince(one.getProvince());
|
|
|
+ zone.setLat(one.getLatGd());
|
|
|
+ zone.setLng(one.getLngGd());
|
|
|
+ }
|
|
|
|
|
|
i += brandZoneDao.insert(zone);
|
|
|
System.out.println(i+"/"+total);
|