4 changed files with 190 additions and 0 deletions
			
			
		@ -0,0 +1,93 @@ | 
				
			|||
package com.epmet.model; | 
				
			|||
 | 
				
			|||
import com.alibaba.excel.context.AnalysisContext; | 
				
			|||
import com.alibaba.excel.event.AnalysisEventListener; | 
				
			|||
import com.epmet.commons.tools.constant.NumConstant; | 
				
			|||
import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			|||
import com.epmet.constant.CustomerGridConstant; | 
				
			|||
import com.epmet.dao.IcBuildingDao; | 
				
			|||
import com.epmet.dto.ImportGeneralDTO; | 
				
			|||
import com.epmet.dto.form.ImportInfoFormDTO; | 
				
			|||
import com.epmet.redis.IcHouseRedis; | 
				
			|||
import com.epmet.service.IcNeighborHoodService; | 
				
			|||
 | 
				
			|||
import java.util.ArrayList; | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author zxc | 
				
			|||
 * @DateTime 2022/2/15 2:16 下午 | 
				
			|||
 * @DESC | 
				
			|||
 */ | 
				
			|||
public class ImportNeighborHoodInfoListener extends AnalysisEventListener<NeighborHoodInfoModel> { | 
				
			|||
 | 
				
			|||
    List<Integer> nums = new ArrayList<>(); | 
				
			|||
    Integer num = NumConstant.ZERO; | 
				
			|||
 | 
				
			|||
    List<ImportGeneralDTO> needDisposeList = new ArrayList<>(); | 
				
			|||
    List<ImportGeneralDTO> needInsertList = new ArrayList<>(); | 
				
			|||
 | 
				
			|||
    String gridName = null; | 
				
			|||
    String agencyName = null; | 
				
			|||
 | 
				
			|||
    Map<String, Object> gridInfos = null; | 
				
			|||
    List<ImportGeneralDTO> gridInfoDTOs = null; | 
				
			|||
    Map<String, Object> neighborHoodInfos = null; | 
				
			|||
    List<ImportGeneralDTO> neighborHoodInfoDTOs = null; | 
				
			|||
    ImportGeneralDTO neighborHoodGeneralDTO = null; | 
				
			|||
 | 
				
			|||
    private ImportInfoFormDTO formDTO; | 
				
			|||
    private IcHouseRedis icHouseRedis; | 
				
			|||
    private IcBuildingDao icBuildingDao; | 
				
			|||
    private IcNeighborHoodService neighborHoodService; | 
				
			|||
 | 
				
			|||
    public ImportNeighborHoodInfoListener(ImportInfoFormDTO formDTO, IcHouseRedis icHouseRedis,IcBuildingDao icBuildingDao,IcNeighborHoodService neighborHoodService){ | 
				
			|||
        this.formDTO = formDTO; | 
				
			|||
        this.icHouseRedis = icHouseRedis; | 
				
			|||
        this.icBuildingDao = icBuildingDao; | 
				
			|||
        this.neighborHoodService = neighborHoodService; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public void invoke(NeighborHoodInfoModel data, AnalysisContext context) { | 
				
			|||
        if (null == data){ | 
				
			|||
            return; | 
				
			|||
        } | 
				
			|||
        num = num + NumConstant.ONE; | 
				
			|||
        ImportGeneralDTO dto = ConvertUtils.sourceToTarget(data, ImportGeneralDTO.class); | 
				
			|||
        dto.setNum(num); | 
				
			|||
        dto.setCustomerId(formDTO.getCustomerId()); | 
				
			|||
        if (formDTO.getOrgType().equals(CustomerGridConstant.GRID)){ | 
				
			|||
            disposeGridNeighborHood(dto); | 
				
			|||
        }else if (formDTO.getOrgType().equals(CustomerGridConstant.AGENCY)){ | 
				
			|||
            disposeAgencyNeighborHood(dto); | 
				
			|||
        } | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @Description  左侧树点击网格时调用 | 
				
			|||
     * @param dto | 
				
			|||
     * @author zxc | 
				
			|||
     * @date 2022/2/15 2:37 下午 | 
				
			|||
     */ | 
				
			|||
    public void disposeGridNeighborHood(ImportGeneralDTO dto){ | 
				
			|||
 | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @Description 左侧树点击组织时调用 | 
				
			|||
     * @param dto | 
				
			|||
     * @author zxc | 
				
			|||
     * @date 2022/2/15 2:37 下午 | 
				
			|||
     */ | 
				
			|||
    public void disposeAgencyNeighborHood(ImportGeneralDTO dto){ | 
				
			|||
 | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public void doAfterAllAnalysed(AnalysisContext context) { | 
				
			|||
 | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
@ -0,0 +1,32 @@ | 
				
			|||
package com.epmet.model; | 
				
			|||
 | 
				
			|||
import com.alibaba.excel.annotation.ExcelProperty; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author zxc | 
				
			|||
 * @DateTime 2022/2/15 2:15 下午 | 
				
			|||
 * @DESC | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class NeighborHoodInfoModel { | 
				
			|||
 | 
				
			|||
    @ExcelProperty(value = "所属组织") | 
				
			|||
    private String agencyName; | 
				
			|||
 | 
				
			|||
    @ExcelProperty(value = "所属网格") | 
				
			|||
    private String gridName; | 
				
			|||
 | 
				
			|||
    @ExcelProperty(value = "小区名称") | 
				
			|||
    private String neighborHoodName; | 
				
			|||
 | 
				
			|||
    @ExcelProperty(value = "关联物业") | 
				
			|||
    private String propertyName; | 
				
			|||
 | 
				
			|||
    @ExcelProperty(value = "详细地址") | 
				
			|||
    private String address; | 
				
			|||
 | 
				
			|||
    @ExcelProperty(value = "备注") | 
				
			|||
    private String remark; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue