Browse Source

Merge remote-tracking branch 'origin/dev_bugfix_ljj' into dev_bugfix_ljj

dev
jianjun 4 years ago
parent
commit
120a4291ed
  1. 19
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java
  2. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java
  3. 5
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java
  4. 12
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcHouseDao.xml

19
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/YuShanSysApiService.java

@ -8,12 +8,9 @@ import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.enums.EnvEnum;
import com.epmet.commons.tools.enums.ExternalApiEnum; import com.epmet.commons.tools.enums.ExternalApiEnum;
import com.epmet.commons.tools.enums.ExternalServerEnum; import com.epmet.commons.tools.enums.ExternalServerEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -35,10 +32,17 @@ public class YuShanSysApiService {
* *
* @return * @return
*/ */
@Async // @Async
public void updateUserPoints(String customerId, List<UpdateUserPointsFormDTO> paramList) { public void updateUserPoints(String customerId, List<UpdateUserPointsFormDTO> paramList) {
/*try {
Thread.sleep(1000l);
} catch (InterruptedException e) {
log.error("调用榆山街道发放积分睡眠发生异常,{}",e);
e.printStackTrace();
}*/
if (StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(paramList)) { if (StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(paramList)) {
throw new RenException("参数错误"); log.warn("updateUserPoints 参数错误");
return;
} }
if (!SpecialCustomerOrgConstant.PING_YIN_CUSTOMER_ID.equals(customerId)) { if (!SpecialCustomerOrgConstant.PING_YIN_CUSTOMER_ID.equals(customerId)) {
return; return;
@ -66,14 +70,13 @@ public class YuShanSysApiService {
// formDTO.setMobile("13205302682"); // formDTO.setMobile("13205302682");
Result<String> res = HttpClientManager.getInstance().sendPostByJSON(apiPath, JSON.toJSONString(formDTO)); Result<String> res = HttpClientManager.getInstance().sendPostByJSON(apiPath, JSON.toJSONString(formDTO));
Result result = JSON.parseObject(res.getData(), Result.class); Result result = JSON.parseObject(res.getData(), Result.class);
log.info(String.format("updateUserPoints 入参:%s;返参:%s", JSON.toJSONString(formDTO),JSON.toJSONString(result))); log.info(String.format("updateUserPoints 入参:%s;返参:%s", JSON.toJSONString(formDTO), JSON.toJSONString(result)));
if (!result.success()) { if (!result.success()) {
log.warn("updateUserPoints failed:{}", JSON.toJSONString(result)); log.warn("updateUserPoints failed:{}", JSON.toJSONString(result));
} }
} }
} catch (Exception e) { } catch (Exception e) {
log.warn("updateUserPoints exception 入参:{}", JSON.toJSONString(formDTO)); log.error("updateUserPoints exception 入参:{},异常:{}", JSON.toJSONString(formDTO), e);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
} }
} }
} }

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/IcHouseRedis.java

@ -24,6 +24,7 @@ import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcHouseDao; import com.epmet.dao.IcHouseDao;
import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.HouseInfoDTO;
import com.epmet.dto.result.ImportResultDTO; import com.epmet.dto.result.ImportResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -38,6 +39,7 @@ import java.util.Map;
* @since v1.0.0 2021-10-27 * @since v1.0.0 2021-10-27
*/ */
@Component @Component
@Slf4j
public class IcHouseRedis { public class IcHouseRedis {
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@ -79,6 +81,10 @@ public class IcHouseRedis {
return ConvertUtils.mapToEntity(map,HouseInfoDTO.class); return ConvertUtils.mapToEntity(map,HouseInfoDTO.class);
} }
HouseInfoDTO houseInfo = icHouseDao.queryHouseInfoByHouseId(houseId); HouseInfoDTO houseInfo = icHouseDao.queryHouseInfoByHouseId(houseId);
if(null == houseInfo){
log.info("Database does not exist this house info, id = {}", houseId);
return null;
}
Map<String, Object> result = BeanUtil.beanToMap(houseInfo, false, true); Map<String, Object> result = BeanUtil.beanToMap(houseInfo, false, true);
setHouseInfo(houseId,result,houseInfo.getCustomerId()); setHouseInfo(houseId,result,houseInfo.getCustomerId());
return houseInfo; return houseInfo;

5
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/HouseServiceImpl.java

@ -325,7 +325,10 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver {
} }
List<HouseInfoDTO> result = new ArrayList<>(); List<HouseInfoDTO> result = new ArrayList<>();
houseIdList.forEach(h -> { houseIdList.forEach(h -> {
result.add(icHouseRedis.getHouseInfo(h,customerId)); HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(h, customerId);
if (null != houseInfo){
result.add(houseInfo);
}
}); });
return result; return result;
} }

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

@ -123,7 +123,9 @@
a.BUILDING_UNIT_ID as unitNumKey, a.BUILDING_UNIT_ID as unitNumKey,
a.HOUSE_TYPE as houseTypeKey, a.HOUSE_TYPE as houseTypeKey,
a.PURPOSE as purposeKey, a.PURPOSE as purposeKey,
a.RENT_FLAG as rentFlagKey a.RENT_FLAG as rentFlagKey,
c.AGENCY_ID as agencyId,
c.GRID_ID as gridId
from ic_house a from ic_house a
LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0' LEFT JOIN ic_building b on a.BUILDING_ID = b.ID and b.DEL_FLAG = '0'
LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0' LEFT JOIN ic_neighbor_hood c on a.NEIGHBOR_HOOD_ID = c.ID and c.DEL_FLAG = '0'
@ -304,6 +306,8 @@
and ih.id !=#{houseId} and ih.id !=#{houseId}
</if> </if>
</select> </select>
<!-- 复制的 queryHouseInfo 方法 -->
<select id="queryHouseInfoByHouseId" resultType="com.epmet.dto.result.HouseInfoDTO"> <select id="queryHouseInfoByHouseId" resultType="com.epmet.dto.result.HouseInfoDTO">
SELECT SELECT
ih.ID as homeId, ih.ID as homeId,
@ -322,9 +326,9 @@
ih.CUSTOMER_ID AS customerId, ih.CUSTOMER_ID AS customerId,
concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName concat(IFNULL(n.NEIGHBOR_HOOD_NAME,''),IFNULL(ib.BUILDING_NAME,''),IFNULL(u.UNIT_NAME,''),IFNULL(ih.HOUSE_NAME,'')) AS allName
FROM ic_house ih FROM ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id ) left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id AND n.DEL_FLAG = '0')
left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id ) left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id AND ib.DEL_FLAG = '0')
left JOIN ic_building_unit u ON ( ih.BUILDING_UNIT_ID = u.ID ) left JOIN ic_building_unit u ON ( ih.BUILDING_UNIT_ID = u.ID AND u.DEL_FLAG = '0')
WHERE WHERE
ih.DEL_FLAG = '0' ih.DEL_FLAG = '0'
AND ih.ID = #{houseId} AND ih.ID = #{houseId}

Loading…
Cancel
Save