Browse Source

Merge remote-tracking branch 'remotes/origin/dev_bugfix_ljj' into 市北生产

feature/teamB_zz_wgh
jianjun 3 years ago
parent
commit
bf5bacb6f3
  1. 1
      epmet-gateway/src/main/resources/bootstrap.yml
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java
  3. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  4. 7
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java
  5. 9
      epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java
  6. 21
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java
  7. 10
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java
  8. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java

1
epmet-gateway/src/main/resources/bootstrap.yml

@ -514,6 +514,7 @@ epmet:
- /gov/org/icbuildingunit/unitoption
- /gov/org/ichouse/houseoption
- /epmetuser/icresicollect/save
- /gov/org/customergrid/gridoption
# 外部应用认证,使用AccessToken等头进行认证
externalOpenUrls:
- /data/report/**

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridMemberStatisticsDailyServiceImpl.java

@ -82,7 +82,7 @@ public class FactGridMemberStatisticsDailyServiceImpl extends BaseServiceImpl<Fa
return;
}
Map<String, StaffRoleInfoDTO> staffMap = staffInfoList.stream().collect(Collectors.toMap(StaffRoleInfoDTO :: getStaffId,
Function.identity()));
Function.identity(), (key1, key2) -> key2));
List<FactGridMemberStatisticsDailyEntity> list = staffGridList.stream().filter(p -> null != staffMap.get(p.getStaffId())).map(item -> {
StaffRoleInfoDTO staffInfo = staffMap.get(item.getStaffId());
return initEntity(customerId, dateId, item, staffInfo);

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -308,6 +308,7 @@ public class CustomerGridController {
* @Return {@link Result<List<OptionResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/26 14:02
* 此接口给城阳小程序使用已经在gateway中放开此接口无需校验token
*/
@PostMapping("gridoption")
public Result<List<OptionResultDTO>> getGridOption(@RequestBody GridOptionFormDTO formDTO){

7
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/controller/ResiMineGridController.java

@ -50,15 +50,16 @@ public class ResiMineGridController {
/**
* @return
* @param appId
* @Author sun
* @Description 单客户-获取用户最近访问网格
* @Date 2020/8/3
**/
@GetMapping("latestgridinfo")
public Result<LatestGridInfoResultDTO> latestGridInfo(@LoginUser TokenDto token, @RequestParam("appId") String appId) {
//public Result<LatestGridInfoResultDTO> latestGridInfo(@LoginUser TokenDto token, @RequestParam("appId") String appId) {
public Result<LatestGridInfoResultDTO> latestGridInfo_new(@LoginUser TokenDto token) {
LatestGridInfoFormDTO formDTO = new LatestGridInfoFormDTO();
formDTO.setAppId(appId);
//formDTO.setAppId(appId);
formDTO.setCustomerId(token.getCustomerId());
formDTO.setUserId(token.getUserId());
return new Result<LatestGridInfoResultDTO>().ok(resiMineGridService.latestGridInfo(formDTO));
}

9
epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java

@ -130,7 +130,10 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
}
}
}
//1.调用third服务,根据appId获取客户Id
/*
//2022.4.29 应前端要求 入参不再传appid值
//1.调用third服务,根据appId获取客户Id
JSONObject jsonObject = new JSONObject();
String customerMsgUrl = "https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/";
String data = HttpClientManager.getInstance().sendPostByJSON(customerMsgUrl + formDTO.getAppId(), JSON.toJSONString(jsonObject)).getData();
@ -148,10 +151,10 @@ public class ResiMineGridServiceImpl implements ResiMineGridService {
JSONObject json = JSON.parseObject(PublicCustomerResultDTO.toString());
Map<String, Object> map = (Map) json.get("customer");
PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class);
logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->" + customer);
logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->" + customer);*/
//2.调用epmet-user服务,根据客户Id和用户Id查询最后一次访问记录
formDTO.setCustomerId(customer.getId());
//formDTO.setCustomerId(customer.getId());
Result<LatestGridInfoResultDTO> userResult = epmetUserOpenFeignClient.latestGridInfo(formDTO);
if (!userResult.success()) {
logger.error(String.format("居民端获取用户最近访问网格失败,接口入参客户Id->%s,appId->%s,调用epmet-user-server服务返回->%s", formDTO.getCustomerId(), formDTO.getAppId(), JSON.toJSONString(userResult)));

21
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/OperUserController.java

@ -18,6 +18,9 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.AppClientConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.EpmetException;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
@ -29,9 +32,11 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.OperUserDTO;
import com.epmet.dto.PasswordDTO;
import com.epmet.dto.result.QueryOperUserResultDto;
import com.epmet.excel.OperUserExcel;
import com.epmet.service.OperUserService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -82,6 +87,22 @@ public class OperUserController {
return new Result();
}
/**
* desc:修改运营端用户 密码
* @param tokenDto
* @param dto
* @return
*/
@PostMapping(value = "updatePwd")
public Result updatePwd(@LoginUser TokenDto tokenDto,@RequestBody PasswordDTO dto) {
if (StringUtils.isBlank(dto.getNewPassword()) && AppClientConstant.APP_OPER.equals(tokenDto.getClient())){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误","参数错误");
}
operUserService.updatePwd(tokenDto.getUserId(),dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids) {
//效验数据

10
epmet-user/epmet-user-server/src/main/java/com/epmet/service/OperUserService.java

@ -20,6 +20,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.OperUserDTO;
import com.epmet.dto.PasswordDTO;
import com.epmet.entity.OperUserEntity;
import java.util.List;
@ -99,4 +100,11 @@ public interface OperUserService extends BaseService<OperUserEntity> {
* @return
*/
OperUserDTO getOperUserInfoById(String id);
}
/**
* desc:修改密码
* @param userId
* @param dto
*/
void updatePwd(String userId, PasswordDTO dto);
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/OperUserServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
@ -29,6 +30,7 @@ import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.OperUserDao;
import com.epmet.dto.OperUserDTO;
import com.epmet.dto.PasswordDTO;
import com.epmet.entity.OperUserEntity;
import com.epmet.entity.UserEntity;
import com.epmet.feign.OperRoleUserFeignClient;
@ -40,6 +42,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -142,4 +145,15 @@ public class OperUserServiceImpl extends BaseServiceImpl<OperUserDao, OperUserEn
return operUserDao.selectOperUserInfoById(id);
}
@Override
public void updatePwd(String userId, PasswordDTO dto) {
OperUserEntity param = new OperUserEntity();
param.setPassword(PasswordUtils.encode(dto.getNewPassword()));
param.setUpdatedTime(new Date());
param.setUpdatedBy(userId);
LambdaQueryWrapper<OperUserEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(OperUserEntity::getUserId,userId);
baseDao.update(param, lambdaQueryWrapper);
}
}

Loading…
Cancel
Save