Browse Source

组织单位列表展示积分

dev
zhaoqifeng 4 years ago
parent
commit
24dad6271a
  1. 5
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
  2. 6
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java
  3. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java
  4. 17
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java
  5. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java
  6. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java
  7. 12
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java
  8. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  9. 11
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  10. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  11. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  12. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

5
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java

@ -115,6 +115,11 @@ public class IcPartyUnitDTO implements Serializable {
*/ */
private String satisfaction; private String satisfaction;
/**
* 评分
*/
private Integer score;
/** /**
* 备注 * 备注
*/ */

6
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/CommunitySelfOrganizationListDTO.java

@ -67,7 +67,10 @@ public class CommunitySelfOrganizationListDTO implements Serializable {
* 社区自组织ID * 社区自组织ID
*/ */
private String orgId; private String orgId;
/**
* 积分
*/
private Integer score;
/** /**
* 社区自组织人员 * 社区自组织人员
*/ */
@ -84,6 +87,7 @@ public class CommunitySelfOrganizationListDTO implements Serializable {
this.longitude = ""; this.longitude = "";
this.latitude = ""; this.latitude = "";
this.orgId = ""; this.orgId = "";
this.score = NumConstant.ZERO;
this.organizationPersonnel = new ArrayList<>(); this.organizationPersonnel = new ArrayList<>();
} }
} }

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/GetListSocietyOrgResultDTO.java

@ -68,6 +68,10 @@ public class GetListSocietyOrgResultDTO implements Serializable {
private String longitude; private String longitude;
//维度 //维度
private String latitude; private String latitude;
/**
* 积分
*/
private Integer score;
} }
} }

17
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/ServicePointDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2022/1/21 15:47
*/
@Data
public class ServicePointDTO implements Serializable {
private static final long serialVersionUID = -1127819263685687151L;
private String serviceId;
private Integer point;
}

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java

@ -59,5 +59,5 @@ public class SocietyOrgListResultDTO implements Serializable {
private String longitude; private String longitude;
//维度 //维度
private String latitude; private String latitude;
private Integer score;
} }

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcUserDemandRecDao.java

@ -24,6 +24,7 @@ import com.epmet.dto.form.demand.IcResiUserDemandFromDTO;
import com.epmet.dto.form.demand.PageListAnalysisFormDTO; import com.epmet.dto.form.demand.PageListAnalysisFormDTO;
import com.epmet.dto.form.demand.UserDemandPageFormDTO; import com.epmet.dto.form.demand.UserDemandPageFormDTO;
import com.epmet.dto.result.PointRecordDTO; import com.epmet.dto.result.PointRecordDTO;
import com.epmet.dto.result.ServicePointDTO;
import com.epmet.dto.result.demand.*; import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity; import com.epmet.entity.IcUserDemandRecEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
@ -129,4 +130,14 @@ public interface IcUserDemandRecDao extends BaseDao<IcUserDemandRecEntity> {
List<PointRecordDTO> getPointRecordList(PointRecordFormDTO formDTO); List<PointRecordDTO> getPointRecordList(PointRecordFormDTO formDTO);
Integer getTotalPoint(PointRecordFormDTO formDTO); Integer getTotalPoint(PointRecordFormDTO formDTO);
/**
* 组织单位积分
* @Param agencyId
* @Param serviceType
* @Return {@link List< ServicePointDTO>}
* @Author zhaoqifeng
* @Date 2022/1/21 15:53
*/
List<ServicePointDTO> getServicePoint(@Param("customerId")String customerId, @Param("serviceType")String serviceType);
} }

12
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcUserDemandRecService.java

@ -27,6 +27,7 @@ import com.epmet.dto.result.demand.*;
import com.epmet.entity.IcUserDemandRecEntity; import com.epmet.entity.IcUserDemandRecEntity;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 居民需求记录表 * 居民需求记录表
@ -235,4 +236,15 @@ public interface IcUserDemandRecService extends BaseService<IcUserDemandRecEntit
* @Date 2022/1/18 9:45 * @Date 2022/1/18 9:45
*/ */
PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO); PointRecordResultDTO pointRecordList(PointRecordFormDTO formDTO);
/**
* 组织单位积分
*
* @Param customerId
* @Param serviceType
* @Return {@link Map< String, Integer>}
* @Author zhaoqifeng
* @Date 2022/1/21 16:02
*/
Map<String, Integer> getServicePoint(String customerId, String serviceType);
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -23,6 +23,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.commons.tools.validator.PhoneValidatorUtils;
import com.epmet.constant.IcCommunitySelfOrganizationConstant; import com.epmet.constant.IcCommunitySelfOrganizationConstant;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcCommunitySelfOrganizationDao; import com.epmet.dao.IcCommunitySelfOrganizationDao;
import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.IcCommunitySelfOrganizationDTO;
import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO;
@ -279,6 +280,8 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
if (null == staffInfo){ if (null == staffInfo){
throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId()));
} }
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(tokenDto.getCustomerId(), UserDemandConstant.COMMUNITY_ORG);
formDTO.setAgencyId(staffInfo.getAgencyId()); formDTO.setAgencyId(staffInfo.getAgencyId());
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE}; final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE};
@ -290,6 +293,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
objectPageInfo.getList().forEach(l -> { objectPageInfo.getList().forEach(l -> {
l.setSort(i[NumConstant.ZERO]); l.setSort(i[NumConstant.ZERO]);
i[NumConstant.ZERO]++; i[NumConstant.ZERO]++;
l.setScore(null == pointMap.get(l.getOrgId())?NumConstant.ZERO:pointMap.get(l.getOrgId()));
}); });
result.setList(objectPageInfo.getList()); result.setList(objectPageInfo.getList());
} }
@ -301,6 +305,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE); AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE);
resultDTOs.forEach(r -> { resultDTOs.forEach(r -> {
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE));
r.setScore(null == pointMap.get(r.getOrgId())?NumConstant.ZERO:pointMap.get(r.getOrgId()));
}); });
result.setList(resultDTOs); result.setList(resultDTOs);
} }

11
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -40,6 +40,7 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils; import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcPartyUnitDao; import com.epmet.dao.IcPartyUnitDao;
import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyActivityFormDTO;
@ -108,7 +109,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
//服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> { dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType())); item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) { if (StringUtils.isNotBlank(item.getServiceMatter())) {
@ -122,6 +124,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
}else{ }else{
item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString()); item.setSatisfaction(new BigDecimal(item.getSatisfaction()).setScale(2,BigDecimal.ROUND_HALF_UP).toString());
} }
item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId()));
}); });
return new PageData<>(dtoList, pageInfo.getTotal()); return new PageData<>(dtoList, pageInfo.getTotal());
} }
@ -142,6 +145,8 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
//服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表 //服务事项列表从需求分类中抽离出来,改为查询ic_service_item_dict表
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId()); List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(formDTO.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dtoList.forEach(item -> { dtoList.forEach(item -> {
item.setType(unitTypeMap.getData().get(item.getType())); item.setType(unitTypeMap.getData().get(item.getType()));
if (StringUtils.isNotBlank(item.getServiceMatter())) { if (StringUtils.isNotBlank(item.getServiceMatter())) {
@ -150,6 +155,7 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
} else { } else {
item.setServiceMatterList(new ArrayList<>()); item.setServiceMatterList(new ArrayList<>());
} }
item.setScore(null == pointMap.get(item.getId())?NumConstant.ZERO:pointMap.get(item.getId()));
}); });
return dtoList; return dtoList;
} }
@ -168,7 +174,10 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
IcPartyUnitEntity entity = baseDao.selectById(id); IcPartyUnitEntity entity = baseDao.selectById(id);
IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class); IcPartyUnitDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyUnitDTO.class);
if (StringUtils.isNotBlank(dto.getServiceMatter())) { if (StringUtils.isNotBlank(dto.getServiceMatter())) {
//获取单位积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(entity.getCustomerId(), UserDemandConstant.PARTY_UNIT);
dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA))); dto.setServiceMatterList(Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)));
dto.setScore(null == pointMap.get(id)?NumConstant.ZERO:pointMap.get(id));
} }
return dto; return dto;
} }

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -25,12 +25,16 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.UserDemandConstant;
import com.epmet.dao.IcSocietyOrgDao; import com.epmet.dao.IcSocietyOrgDao;
import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.IcSocietyOrgDTO; import com.epmet.dto.IcSocietyOrgDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.OrgInfoResultDTO;
import com.epmet.dto.result.SocietyOrgListResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.entity.IcSocietyOrgEntity;
import com.epmet.excel.IcSocietyOrgExcel; import com.epmet.excel.IcSocietyOrgExcel;
@ -127,7 +131,8 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
return resultDTO; return resultDTO;
} }
resultDTO.setTotal((int) result.getTotal()); resultDTO.setTotal((int) result.getTotal());
//获取组织积分
Map<String, Integer> pointMap = icUserDemandRecService.getServicePoint(formDTO.getCustomerId(), UserDemandConstant.SOCIAL_ORG);
//2.查询被绑定管理员信息 //2.查询被绑定管理员信息
UserIdsFormDTO dto = new UserIdsFormDTO(); UserIdsFormDTO dto = new UserIdsFormDTO();
List<String> staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList()); List<String> staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList());
@ -150,7 +155,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
throw new RenException("获取组织基础信息失败......"); throw new RenException("获取组织基础信息失败......");
} }
result.getList().forEach(r -> orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName()))); result.getList().forEach(r -> orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName())));
result.getList().forEach(item -> {
item.setScore(null == pointMap.get(item.getSocietyId())?NumConstant.ZERO:pointMap.get(item.getSocietyId()));
});
resultDTO.setList(result.getList()); resultDTO.setList(result.getList());
return resultDTO; return resultDTO;
} }

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -1684,5 +1684,25 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
return result; return result;
} }
/**
* 组织单位积分
*
* @param customerId
* @param serviceType
* @Param customerId
* @Param serviceType
* @Return {@link Map< String, Integer>}
* @Author zhaoqifeng
* @Date 2022/1/21 16:02
*/
@Override
public Map<String, Integer> getServicePoint(String customerId, String serviceType) {
List<ServicePointDTO> list = baseDao.getServicePoint(customerId, serviceType);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.toMap(ServicePointDTO::getServiceId, ServicePointDTO::getPoint));
}
} }

20
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -618,4 +618,24 @@
AND c.EVALUATE_TIME &lt;= #{endTime} AND c.EVALUATE_TIME &lt;= #{endTime}
</if> </if>
</select> </select>
<select id="getServicePoint" resultType="com.epmet.dto.result.ServicePointDTO">
SELECT
b.SERVER_ID,
SUM( a.AWARD_POINT ) AS point
FROM
ic_user_demand_rec a
INNER JOIN ic_user_demand_service b ON a.ID = b.DEMAND_REC_ID
AND b.SERVICE_TYPE = #{serviceType}
AND b.DEL_FLAG = '0'
INNER JOIN ic_user_demand_satisfaction c ON a.ID = c.DEMAND_REC_ID
AND c.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
AND a.`STATUS` = 'finished'
AND a.EVALUATE_FLAG = 1
AND b.CUSTOMER_ID = #{customerId}
GROUP BY
b.SERVER_ID
</select>
</mapper> </mapper>
Loading…
Cancel
Save