7 changed files with 53 additions and 184 deletions
			
			
		@ -1,30 +0,0 @@ | 
				
			|||||
/** | 
					 | 
				
			||||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is free software: you can redistribute it and/or modify | 
					 | 
				
			||||
 * it under the terms of the GNU General Public License as published by | 
					 | 
				
			||||
 * the Free Software Foundation, either version 3 of the License, or | 
					 | 
				
			||||
 * (at your option) any later version. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is distributed in the hope that it will be useful, | 
					 | 
				
			||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					 | 
				
			||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					 | 
				
			||||
 * GNU General Public License for more details. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * You should have received a copy of the GNU General Public License | 
					 | 
				
			||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					 | 
				
			||||
 */ | 
					 | 
				
			||||
 | 
					 | 
				
			||||
package com.epmet.dao; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
import com.epmet.commons.mybatis.dao.BaseDao; | 
					 | 
				
			||||
import com.epmet.entity.StrangerEntity; | 
					 | 
				
			||||
import org.apache.ibatis.annotations.Mapper; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
/** | 
					 | 
				
			||||
 * @author sun | 
					 | 
				
			||||
 */ | 
					 | 
				
			||||
@Mapper | 
					 | 
				
			||||
public interface StrangerDao extends BaseDao<StrangerEntity> { | 
					 | 
				
			||||
	 | 
					 | 
				
			||||
} | 
					 | 
				
			||||
@ -1,33 +0,0 @@ | 
				
			|||||
/** | 
					 | 
				
			||||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is free software: you can redistribute it and/or modify | 
					 | 
				
			||||
 * it under the terms of the GNU General Public License as published by | 
					 | 
				
			||||
 * the Free Software Foundation, either version 3 of the License, or | 
					 | 
				
			||||
 * (at your option) any later version. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is distributed in the hope that it will be useful, | 
					 | 
				
			||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					 | 
				
			||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					 | 
				
			||||
 * GNU General Public License for more details. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * You should have received a copy of the GNU General Public License | 
					 | 
				
			||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					 | 
				
			||||
 */ | 
					 | 
				
			||||
 | 
					 | 
				
			||||
package com.epmet.entity; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableName; | 
					 | 
				
			||||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | 
					 | 
				
			||||
import lombok.Data; | 
					 | 
				
			||||
import lombok.EqualsAndHashCode; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
@Data | 
					 | 
				
			||||
@EqualsAndHashCode(callSuper=false) | 
					 | 
				
			||||
@TableName("stranger") | 
					 | 
				
			||||
public class StrangerEntity extends BaseEpmetEntity { | 
					 | 
				
			||||
 | 
					 | 
				
			||||
	private static final long serialVersionUID = 1L; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
 | 
					 | 
				
			||||
} | 
					 | 
				
			||||
@ -1,35 +0,0 @@ | 
				
			|||||
/** | 
					 | 
				
			||||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is free software: you can redistribute it and/or modify | 
					 | 
				
			||||
 * it under the terms of the GNU General Public License as published by | 
					 | 
				
			||||
 * the Free Software Foundation, either version 3 of the License, or | 
					 | 
				
			||||
 * (at your option) any later version. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is distributed in the hope that it will be useful, | 
					 | 
				
			||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					 | 
				
			||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					 | 
				
			||||
 * GNU General Public License for more details. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * You should have received a copy of the GNU General Public License | 
					 | 
				
			||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					 | 
				
			||||
 */ | 
					 | 
				
			||||
 | 
					 | 
				
			||||
package com.epmet.service; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
import com.epmet.commons.mybatis.service.BaseService; | 
					 | 
				
			||||
import com.epmet.commons.tools.utils.Result; | 
					 | 
				
			||||
import com.epmet.dto.form.StrangerFormDTO; | 
					 | 
				
			||||
import com.epmet.dto.result.HomeDesignByCustomerResultDTO; | 
					 | 
				
			||||
import com.epmet.entity.StrangerEntity; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
public interface StrangerService extends BaseService<StrangerEntity> { | 
					 | 
				
			||||
 | 
					 | 
				
			||||
    /** | 
					 | 
				
			||||
     * 居民端-网格链接获取客户首页配置 | 
					 | 
				
			||||
     * @param | 
					 | 
				
			||||
     * @return void | 
					 | 
				
			||||
     * @author sun | 
					 | 
				
			||||
     */ | 
					 | 
				
			||||
	Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO); | 
					 | 
				
			||||
} | 
					 | 
				
			||||
@ -1,79 +0,0 @@ | 
				
			|||||
/** | 
					 | 
				
			||||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is free software: you can redistribute it and/or modify | 
					 | 
				
			||||
 * it under the terms of the GNU General Public License as published by | 
					 | 
				
			||||
 * the Free Software Foundation, either version 3 of the License, or | 
					 | 
				
			||||
 * (at your option) any later version. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * This program is distributed in the hope that it will be useful, | 
					 | 
				
			||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					 | 
				
			||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
					 | 
				
			||||
 * GNU General Public License for more details. | 
					 | 
				
			||||
 * <p> | 
					 | 
				
			||||
 * You should have received a copy of the GNU General Public License | 
					 | 
				
			||||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
					 | 
				
			||||
 */ | 
					 | 
				
			||||
 | 
					 | 
				
			||||
package com.epmet.service.impl; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
					 | 
				
			||||
import com.epmet.commons.tools.utils.Result; | 
					 | 
				
			||||
import com.epmet.dao.StrangerDao; | 
					 | 
				
			||||
import com.epmet.dto.form.CustomerHomeFormDTO; | 
					 | 
				
			||||
import com.epmet.dto.form.StrangerFormDTO; | 
					 | 
				
			||||
import com.epmet.dto.form.VisitedFormDTO; | 
					 | 
				
			||||
import com.epmet.dto.result.HomeDesignByCustomerResultDTO; | 
					 | 
				
			||||
import com.epmet.entity.StrangerEntity; | 
					 | 
				
			||||
import com.epmet.feign.EpmetUserFeignClient; | 
					 | 
				
			||||
import com.epmet.feign.OperCustomizeFeignClient; | 
					 | 
				
			||||
import com.epmet.service.StrangerService; | 
					 | 
				
			||||
import org.springframework.beans.factory.annotation.Autowired; | 
					 | 
				
			||||
import org.springframework.stereotype.Service; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
/** | 
					 | 
				
			||||
 * 居民端-陌生人导览 | 
					 | 
				
			||||
 * | 
					 | 
				
			||||
 * @author sun | 
					 | 
				
			||||
 * @since v1.0.0 2020-03-11 | 
					 | 
				
			||||
 */ | 
					 | 
				
			||||
@Service | 
					 | 
				
			||||
public class StrangerServiceImpl extends BaseServiceImpl<StrangerDao, StrangerEntity> implements StrangerService { | 
					 | 
				
			||||
 | 
					 | 
				
			||||
    @Autowired | 
					 | 
				
			||||
    private EpmetUserFeignClient epmetUserFeignClient; | 
					 | 
				
			||||
    @Autowired | 
					 | 
				
			||||
    private OperCustomizeFeignClient operCustomizeFeignClient; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
    /** | 
					 | 
				
			||||
     * 居民端-网格链接获取客户首页配置 | 
					 | 
				
			||||
     * @return void | 
					 | 
				
			||||
     * @author sun | 
					 | 
				
			||||
     */ | 
					 | 
				
			||||
    @Override | 
					 | 
				
			||||
    public Result<HomeDesignByCustomerResultDTO> getgridhome(StrangerFormDTO formDTO) { | 
					 | 
				
			||||
        //token里边有所属端 userId这些参数 前台传递customerID和gridId
 | 
					 | 
				
			||||
        //1:调用epmet-user服务查询数据 新建网格记录数据
 | 
					 | 
				
			||||
        VisitedFormDTO vi = new VisitedFormDTO(); | 
					 | 
				
			||||
        vi.setGridId(formDTO.getGridId()); | 
					 | 
				
			||||
        vi.setCustomerId(formDTO.getCustomerId()); | 
					 | 
				
			||||
        //vi.setUserId(token获取);
 | 
					 | 
				
			||||
        epmetUserFeignClient.saveLatestAndVisited(vi); | 
					 | 
				
			||||
 | 
					 | 
				
			||||
        //2:调用ope-customize服务 获取首页发布数据
 | 
					 | 
				
			||||
        Result<HomeDesignByCustomerResultDTO> res = getCustomerHomeData(formDTO.getCustomerId()); | 
					 | 
				
			||||
        return res; | 
					 | 
				
			||||
 | 
					 | 
				
			||||
    } | 
					 | 
				
			||||
 | 
					 | 
				
			||||
    /** | 
					 | 
				
			||||
     * 调用oper-customize服务 获取首页发布数据 | 
					 | 
				
			||||
     */ | 
					 | 
				
			||||
    public Result<HomeDesignByCustomerResultDTO> getCustomerHomeData(String customerId){ | 
					 | 
				
			||||
        CustomerHomeFormDTO dto = new CustomerHomeFormDTO(); | 
					 | 
				
			||||
        dto.setCustomerId(customerId); | 
					 | 
				
			||||
        //dto.setClientType(token中获取);//居民端
 | 
					 | 
				
			||||
        return operCustomizeFeignClient.getHomeReleaseByCustomer(dto); | 
					 | 
				
			||||
    } | 
					 | 
				
			||||
 | 
					 | 
				
			||||
} | 
					 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue