Browse Source

pc提交需求,修改需求记录需求人的houseId,房屋地址,楼的经纬度,记录发放积分

master
yinzuomei 4 years ago
parent
commit
20372fa35d
  1. 2
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java
  2. 1
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java
  3. 28
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java
  4. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java
  5. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcResiDemandDictServiceImpl.java
  6. 51
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  7. 8
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql
  8. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  9. 14
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java
  10. 5
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml
  11. 8
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  12. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  13. 12
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  14. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java
  15. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

2
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java

@ -66,4 +66,6 @@ public interface IcResiDemandDictDao extends BaseDao<IcResiDemandDictEntity> {
List<IcResiDemandDictEntity> selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List<String> categoryCodes);
String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode);
IcResiDemandDictEntity selectByCode(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode);
}

1
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java

@ -79,4 +79,5 @@ public class IcResiDemandDictEntity extends BaseEpmetEntity {
* 1可用0不可用,11.17
*/
private Boolean usableFlag;
}

28
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java

@ -143,4 +143,32 @@ public class IcUserDemandRecEntity extends BaseEpmetEntity {
*/
private Boolean evaluateFlag;
/**
* 奖励积分
*/
private Integer awardPoint;
/**
* 服务地点工作端指派默认居民居住房屋地址居民端地图选择
*/
private String serviceLocation;
/**
* 门牌号详细地址
*/
private String locationDetail;
/**
* 经度,需求人是ic的居民时取所住楼栋的中心点位
*/
private String longitude;
/**
* 纬度,需求人是ic的居民时取所住楼栋的中心点位
*/
private String latitude;
/**
* 需求人是ic的居民时,记录下住的房屋id
*/
private String demandUserHouseId;
}

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java

@ -119,4 +119,13 @@ public interface IcResiDemandDictService extends BaseService<IcResiDemandDictEnt
* @return
*/
String getCategoryName(String customerId, String categoryCode);
/**
* 根据编码获取分类信息
*
* @param customerId
* @param categoryCode
* @return
*/
IcResiDemandDictEntity getByCode(String customerId, String categoryCode);
}

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

@ -258,5 +258,10 @@ public class IcResiDemandDictServiceImpl extends BaseServiceImpl<IcResiDemandDic
return StringUtils.isNotBlank(categoryName)?categoryName: StrConstant.EPMETY_STR;
}
@Override
public IcResiDemandDictEntity getByCode(String customerId, String categoryCode) {
return baseDao.selectByCode(customerId,categoryCode);
}
}

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

@ -40,6 +40,7 @@ import com.epmet.dao.IcUserDemandSatisfactionDao;
import com.epmet.dao.IcUserDemandServiceDao;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerGridDTO;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.CustomerGridFormDTO;
import com.epmet.dto.form.FindIcUserFormDTO;
@ -154,6 +155,31 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
updateEntity.setStatus(UserDemandConstant.PENDING);
updateEntity.setEvaluateFlag(false);
updateEntity.setId(dto.getDemandRecId());
//记录发放积分
IcResiDemandDictEntity icResiDemandDictEntity=demandDictService.getByCode(dto.getCustomerId(),dto.getCategoryCode());
if(null!=icResiDemandDictEntity){
updateEntity.setAwardPoint(icResiDemandDictEntity.getAwardPoint());
}
//查找需求人居住的房子
Result<IcResiUserDTO> demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(dto.getDemandUserId());
if(!demandUserRes.success()||null==demandUserRes.getData()){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常");
}
updateEntity.setDemandUserHouseId(demandUserRes.getData().getVillageId());
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(updateEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
if(houseInfoRes.success()&&CollectionUtils.isNotEmpty(houseInfoRes.getData())){
HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO);
updateEntity.setServiceLocation(houseInfoDTO.getNeighborAddress().
concat(houseInfoDTO.getNeighborHoodName())
.concat(houseInfoDTO.getBuildingName())
.concat(houseInfoDTO.getUnitName())
.concat(houseInfoDTO.getDoorName()));
updateEntity.setLongitude(houseInfoDTO.getBuildingLongitude());
updateEntity.setLatitude(houseInfoDTO.getBuildingLatitude());
}
baseDao.updateById(updateEntity);
IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity();
@ -197,6 +223,31 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
insertEntity.setDemandUserType(UserDemandConstant.IC_RESI_USER);
insertEntity.setStatus(UserDemandConstant.PENDING);
insertEntity.setEvaluateFlag(false);
//记录发放积分
IcResiDemandDictEntity icResiDemandDictEntity=demandDictService.getByCode(fromDTO.getCustomerId(),fromDTO.getCategoryCode());
if(null!=icResiDemandDictEntity){
insertEntity.setAwardPoint(icResiDemandDictEntity.getAwardPoint());
}
//查找需求人居住的房子
Result<IcResiUserDTO> demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(fromDTO.getDemandUserId());
if(!demandUserRes.success()||null==demandUserRes.getData()){
throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常");
}
insertEntity.setDemandUserHouseId(demandUserRes.getData().getVillageId());
// 查询需求人的居住地址
Set<String> houseIds=new HashSet<>();
houseIds.add(insertEntity.getDemandUserHouseId());
Result<List<HouseInfoDTO>> houseInfoRes=govOrgOpenFeignClient.queryListHouseInfo(houseIds);
if(houseInfoRes.success()&&CollectionUtils.isNotEmpty(houseInfoRes.getData())){
HouseInfoDTO houseInfoDTO=houseInfoRes.getData().get(NumConstant.ZERO);
insertEntity.setServiceLocation(houseInfoDTO.getNeighborAddress().
concat(houseInfoDTO.getNeighborHoodName())
.concat(houseInfoDTO.getBuildingName())
.concat(houseInfoDTO.getUnitName())
.concat(houseInfoDTO.getDoorName()));
insertEntity.setLongitude(houseInfoDTO.getBuildingLongitude());
insertEntity.setLatitude(houseInfoDTO.getBuildingLatitude());
}
baseDao.insert(insertEntity);
IcUserDemandOperateLogEntity logEntity=new IcUserDemandOperateLogEntity();
logEntity.setCustomerId(fromDTO.getCustomerId());

8
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql

@ -0,0 +1,8 @@
alter table ic_user_demand_rec add COLUMN AWARD_POINT int(11) not null default '0' comment '奖励积分',
add COLUMN SERVICE_LOCATION VARCHAR(255) NOT NULL DEFAULT '' COMMENT '服务地点,工作端指派默认居民居住房屋地址,居民端地图选择',
add COLUMN LOCATION_DETAIL VARCHAR(255) DEFAULT'' COMMENT '门牌号详细地址',
add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度,需求人是ic的居民时,取所住楼栋的中心点位',
add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度,需求人是ic的居民时,取所住楼栋的中心点位',
add COLUMN DEMAND_USER_HOUSE_ID VARCHAR(64) DEFAULT'' COMMENT '需求人是ic的居民时,记录下住的房屋id';
alter table volunteer_info add COLUMN PID VARCHAR(64) comment '网格所属的组织id' after GRID_ID;
alter table volunteer_info add COLUMN PIDS VARCHAR(255) comment '网格的所有上级' after PID;

7
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -247,4 +247,11 @@
AND m.CUSTOMER_ID = #{customerId}
AND m.CATEGORY_CODE = #{categoryCode}
</select>
<select id="selectByCode" parameterType="map" resultType="com.epmet.entity.IcResiDemandDictEntity">
select * from ic_resi_demand_dict
where del_flag='0'
and customer_id=#{customerId}
and category_code=#{categoryCode}
</select>
</mapper>

14
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java

@ -17,7 +17,10 @@ public class HouseInfoDTO implements Serializable {
*/
private String homeId;
/**
* 小区详细地址
*/
private String neighborAddress;
/**
* 小区id
*/
@ -59,4 +62,13 @@ public class HouseInfoDTO implements Serializable {
private String houseType;
private String houseName;
/**
* 楼的经度
*/
private String buildingLongitude;
/**
* 楼的纬度
*/
private String buildingLatitude;
}

5
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

@ -233,6 +233,7 @@
<select id="queryHouseInfo" parameterType="map" resultType="com.epmet.dto.result.HouseInfoDTO">
SELECT
ih.ID as homeId,
n.ADDRESS as neighborAddress,
ih.NEIGHBOR_HOOD_ID as neighborHoodId,
n.NEIGHBOR_HOOD_NAME as neighborHoodName,
ih.BUILDING_ID as buildingId,
@ -241,7 +242,9 @@
u.UNIT_NAME as unitName,
ih.DOOR_NAME as doorName,
ih.house_type,
ih.HOUSE_NAME
ih.HOUSE_NAME,
ib.LONGITUDE as buildingLongitude,
ib.LATITUDE as buildingLatitude
FROM
ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id )

8
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -681,4 +681,12 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping(value = "/epmetuser/user/findicuser")
Result<EpmetUserFamilyDTO> findIcUser(@RequestBody FindIcUserFormDTO formDTO);
/**
* 获取ic_resi_user
* @param icResiUserId
* @return
*/
@GetMapping("/epmetuser/icresiuser/geticresiuser/{icResiUserId}")
Result<IcResiUserDTO> getIcResiUserDTO(String icResiUserId);
}

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -506,4 +506,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<EpmetUserFamilyDTO> findIcUser(FindIcUserFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "findIcUser", formDTO);
}
@Override
public Result<IcResiUserDTO> getIcResiUserDTO(String icResiUserId) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getIcResiUserDTO", icResiUserId);
}
}

12
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -571,4 +571,16 @@ public class IcResiUserController {
return new Result<IcResiUserBriefDTO>().ok(r);
}
/**
* 获取ic_resi_user
* @param icResiUserId
* @return
*/
@GetMapping("geticresiuser/{icResiUserId}")
public Result<IcResiUserDTO> getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId){
if(StringUtils.isNotBlank(icResiUserId)){
return new Result<IcResiUserDTO>().ok(icResiUserService.get(icResiUserId));
}
return new Result<>();
}
}

7
epmet-user/epmet-user-server/src/main/java/com/epmet/service/IcResiUserService.java

@ -192,4 +192,11 @@ public interface IcResiUserService extends BaseService<IcResiUserEntity> {
PageData<PartyMemberEducationResultDTO> getPartyMemberEducationList(PartyMemberListFormDTO formDTO);
IcResiUserBriefDTO getResiBrief(String resiUserId, String customerId);
/**
* 获取居民主表记录
* @param icResiUserId
* @return
*/
IcResiUserDTO get(String icResiUserId);
}

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -937,6 +937,12 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return r;
}
@Override
public IcResiUserDTO get(String icResiUserId) {
IcResiUserEntity icResiUserEntity=baseDao.selectById(icResiUserId);
return ConvertUtils.sourceToTarget(icResiUserEntity,IcResiUserDTO.class);
}
/**
* 查询志愿者类别options
* @param customerId

Loading…
Cancel
Save