From 20372fa35d89bdd4ad3528aac015d8950c68d4ed Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 21 Dec 2021 15:39:52 +0800 Subject: [PATCH] =?UTF-8?q?pc=E6=8F=90=E4=BA=A4=E9=9C=80=E6=B1=82=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9C=80=E6=B1=82=E8=AE=B0=E5=BD=95=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E4=BA=BA=E7=9A=84houseId=EF=BC=8C=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=EF=BC=8C=E6=A5=BC=E7=9A=84=E7=BB=8F=E7=BA=AC?= =?UTF-8?q?=E5=BA=A6=EF=BC=8C=E8=AE=B0=E5=BD=95=E5=8F=91=E6=94=BE=E7=A7=AF?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/IcResiDemandDictDao.java | 2 + .../epmet/entity/IcResiDemandDictEntity.java | 1 + .../epmet/entity/IcUserDemandRecEntity.java | 28 ++++++++++ .../service/IcResiDemandDictService.java | 9 ++++ .../impl/IcResiDemandDictServiceImpl.java | 5 ++ .../impl/IcUserDemandRecServiceImpl.java | 51 +++++++++++++++++++ .../V0.0.4__awardpoint_volunteerpid.sql | 8 +++ .../resources/mapper/IcResiDemandDictDao.xml | 7 +++ .../com/epmet/dto/result/HouseInfoDTO.java | 14 ++++- .../src/main/resources/mapper/IcHouseDao.xml | 5 +- .../epmet/feign/EpmetUserOpenFeignClient.java | 8 +++ .../EpmetUserOpenFeignClientFallback.java | 5 ++ .../controller/IcResiUserController.java | 14 ++++- .../com/epmet/service/IcResiUserService.java | 7 +++ .../service/impl/IcResiUserServiceImpl.java | 6 +++ 15 files changed, 167 insertions(+), 3 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java index 211ab20e8d..8142b0c659 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcResiDemandDictDao.java @@ -66,4 +66,6 @@ public interface IcResiDemandDictDao extends BaseDao { List selectSecondCodes(@Param("customerId") String customerId, @Param("cateogryCodes") List categoryCodes); String selectNameByCode(@Param("customerId")String customerId, @Param("categoryCode") String categoryCode); + + IcResiDemandDictEntity selectByCode(@Param("customerId") String customerId, @Param("categoryCode") String categoryCode); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java index 1b9a30b755..73ed4137d9 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcResiDemandDictEntity.java +++ b/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; + } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java index 5979d780ed..0d54cd6184 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcUserDemandRecEntity.java +++ b/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; } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java index 12cbaf7dad..716956d292 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcResiDemandDictService.java @@ -119,4 +119,13 @@ public interface IcResiDemandDictService extends BaseService demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(dto.getDemandUserId()); + if(!demandUserRes.success()||null==demandUserRes.getData()){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"); + } + updateEntity.setDemandUserHouseId(demandUserRes.getData().getVillageId()); + // 查询需求人的居住地址 + Set houseIds=new HashSet<>(); + houseIds.add(updateEntity.getDemandUserHouseId()); + Result> 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 demandUserRes=epmetUserOpenFeignClient.getIcResiUserDTO(fromDTO.getDemandUserId()); + if(!demandUserRes.success()||null==demandUserRes.getData()){ + throw new EpmetException(EpmetErrorCode.SERVER_ERROR.getCode(), "查询需求人信息异常"); + } + insertEntity.setDemandUserHouseId(demandUserRes.getData().getVillageId()); + // 查询需求人的居住地址 + Set houseIds=new HashSet<>(); + houseIds.add(insertEntity.getDemandUserHouseId()); + Result> 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()); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/db/migration/V0.0.4__awardpoint_volunteerpid.sql new file mode 100644 index 0000000000..769e943842 --- /dev/null +++ b/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; \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml index d9d79ecaec..9be81d0e7e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml +++ b/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} + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java index 5077e99a33..853558739b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/HouseInfoDTO.java +++ b/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; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml index 61aa971630..e1162beed5 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml @@ -233,6 +233,7 @@