|
|
@ -26,6 +26,7 @@ import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.constant.StrConstant; |
|
|
|
import com.epmet.commons.tools.dto.result.OptionResultDTO; |
|
|
|
import com.epmet.commons.tools.enums.DictTypeEnum; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
@ -43,6 +44,7 @@ import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.*; |
|
|
|
import com.epmet.entity.CustomerAgencyEntity; |
|
|
|
import com.epmet.entity.CustomerGridEntity; |
|
|
|
import com.epmet.feign.EpmetAdminOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetMessageOpenFeignClient; |
|
|
|
import com.epmet.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.feign.OperCrmOpenFeignClient; |
|
|
@ -51,6 +53,7 @@ import com.epmet.service.CustomerGridService; |
|
|
|
import com.epmet.util.ModuleConstant; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
@ -87,6 +90,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu |
|
|
|
private RedisUtils redisUtils; |
|
|
|
@Autowired |
|
|
|
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |
|
|
|
@Autowired |
|
|
|
private EpmetAdminOpenFeignClient adminOpenFeignClient; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageData<CustomerGridDTO> page(Map<String, Object> params) { |
|
|
@ -216,6 +221,12 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu |
|
|
|
//获取人员具体信息(头像、名字...)
|
|
|
|
Result<List<StaffGridListDTO>> staffGridList = epmetUserFeignClient.getStaffGridList(customerStaffGridDTOS); |
|
|
|
griddetail.setStaffGridList(staffGridList.getData()); |
|
|
|
//查询网格类型字典表数据
|
|
|
|
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); |
|
|
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
|
|
|
if (StringUtils.isNotBlank(griddetail.getGridType())) { |
|
|
|
griddetail.setGridTypeName(statusMap.get(griddetail.getGridType())); |
|
|
|
} |
|
|
|
return new Result<GridDetailResultDTO>().ok(griddetail); |
|
|
|
} |
|
|
|
|
|
|
@ -356,7 +367,23 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu |
|
|
|
**/ |
|
|
|
@Override |
|
|
|
public Result<List<GridBaseInfoResultDTO>> getAllGridsByAgency(CommonAgencyIdFormDTO agencyFormDTO) { |
|
|
|
return new Result<List<GridBaseInfoResultDTO>>().ok(baseDao.selectGridListByAgencyId(agencyFormDTO.getAgencyId(),null)); |
|
|
|
//1.查询组织下网格列表数据
|
|
|
|
List<GridBaseInfoResultDTO> list = baseDao.selectGridListByAgencyId(agencyFormDTO.getAgencyId(),null); |
|
|
|
if (org.springframework.util.CollectionUtils.isEmpty(list)) { |
|
|
|
return new Result<List<GridBaseInfoResultDTO>>(); |
|
|
|
} |
|
|
|
|
|
|
|
//2.查询网格类型字典表数据
|
|
|
|
Result<Map<String, String>> statusRes = adminOpenFeignClient.dictMap(DictTypeEnum.USER_DEMAND_STATUS.getCode()); |
|
|
|
Map<String, String> statusMap = statusRes.success() && MapUtils.isNotEmpty(statusRes.getData()) ? statusRes.getData() : new HashMap<>(); |
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
|
list.forEach(l->{ |
|
|
|
if (StringUtils.isNotBlank(l.getGridType())) { |
|
|
|
l.setGridTypeName(statusMap.get(l.getGridType())); |
|
|
|
} |
|
|
|
}); |
|
|
|
return new Result<List<GridBaseInfoResultDTO>>().ok(list); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|