Browse Source

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

master
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.ExternalApiEnum;
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 lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@ -35,10 +32,17 @@ public class YuShanSysApiService {
*
* @return
*/
@Async
// @Async
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)) {
throw new RenException("参数错误");
log.warn("updateUserPoints 参数错误");
return;
}
if (!SpecialCustomerOrgConstant.PING_YIN_CUSTOMER_ID.equals(customerId)) {
return;
@ -66,14 +70,13 @@ public class YuShanSysApiService {
// formDTO.setMobile("13205302682");
Result<String> res = HttpClientManager.getInstance().sendPostByJSON(apiPath, JSON.toJSONString(formDTO));
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()) {
log.warn("updateUserPoints failed:{}", JSON.toJSONString(result));
}
}
} catch (Exception e) {
log.warn("updateUserPoints exception 入参:{}", JSON.toJSONString(formDTO));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage());
log.error("updateUserPoints exception 入参:{},异常:{}", JSON.toJSONString(formDTO), e);
}
}
}

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.dto.result.HouseInfoDTO;
import com.epmet.dto.result.ImportResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
@ -38,6 +39,7 @@ import java.util.Map;
* @since v1.0.0 2021-10-27
*/
@Component
@Slf4j
public class IcHouseRedis {
@Autowired
private RedisUtils redisUtils;
@ -79,6 +81,10 @@ public class IcHouseRedis {
return ConvertUtils.mapToEntity(map,HouseInfoDTO.class);
}
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);
setHouseInfo(houseId,result,houseInfo.getCustomerId());
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<>();
houseIdList.forEach(h -> {
result.add(icHouseRedis.getHouseInfo(h,customerId));
HouseInfoDTO houseInfo = icHouseRedis.getHouseInfo(h, customerId);
if (null != houseInfo){
result.add(houseInfo);
}
});
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.HOUSE_TYPE as houseTypeKey,
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
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'
@ -304,6 +306,8 @@
and ih.id !=#{houseId}
</if>
</select>
<!-- 复制的 queryHouseInfo 方法 -->
<select id="queryHouseInfoByHouseId" resultType="com.epmet.dto.result.HouseInfoDTO">
SELECT
ih.ID as homeId,
@ -322,9 +326,9 @@
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
FROM ic_house ih
left JOIN ic_neighbor_hood n ON ( ih.NEIGHBOR_HOOD_ID = n.id )
left JOIN ic_building ib ON ( ih.BUILDING_ID = ib.id )
left JOIN ic_building_unit u ON ( ih.BUILDING_UNIT_ID = u.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 AND ib.DEL_FLAG = '0')
left JOIN ic_building_unit u ON ( ih.BUILDING_UNIT_ID = u.ID AND u.DEL_FLAG = '0')
WHERE
ih.DEL_FLAG = '0'
AND ih.ID = #{houseId}

Loading…
Cancel
Save