Commit 88d5fce8 authored by kongfm's avatar kongfm

BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16

parent e9a2d03e
......@@ -7,8 +7,12 @@ import com.yeejoin.amos.boot.module.common.api.dto.*;
import com.yeejoin.amos.boot.module.common.api.entity.OrgUsr;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.OrgUsrServiceImpl;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -165,12 +169,22 @@ public class OrgPersonController {
@RequestMapping(value = "/{orgCode}/users", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据orgCode查询", notes = "根据orgCode查询")
public ResponseModel<Collection<OrgUsr>> selectUsersByOrgCode(HttpServletRequest request, String pageNum,
String pageSize, @PathVariable Long orgCode) {
String pageSize, @PathVariable String orgCode) {
Map<String, Object> columnMap = new HashMap<>();
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_code", orgCode);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
return ResponseHelper.buildResponse(iOrgUsrService.listByMap(columnMap));
Collection<OrgUsr> temp = iOrgUsrService.listByMap(columnMap);
temp.stream().forEach(t -> {
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
if(StringUtils.isNotEmpty(t.getAmosOrgId())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(t.getAmosOrgId());
if(null !=result1.getResult()) {
t.setAmosOrgCode(result1.getResult().getRealName());
}
}
});
return ResponseHelper.buildResponse(temp);
}
/**
......
package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -379,7 +380,16 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
map.put("pageNum", (pageBean.getCurrent() - 1) * pageBean.getSize());
map.put("pageSize", pageBean.getSize());
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
list.stream().forEach(t -> {
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
if(null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(t.get("amosOrgId").toString());
if(null !=result1.getResult()) {
t.put("amosOrgCode",result1.getResult().getRealName());
}
}
});
/*Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束*/
pageBean.setRecords(list);
return pageBean;
......@@ -543,7 +553,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Map<String, Object> result = new HashMap<>();
// 机场人员AMOS角色丢失修正, by litw start 2021年9月10日
if(null != orgUsr.getAmosOrgId()) {
if(StringUtils.isNotEmpty(orgUsr.getAmosOrgId())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(orgUsr.getAmosOrgId());
if(null !=result1.getResult()) {
orgUsr.setAmosOrgCode(result1.getResult().getRealName());
......@@ -768,6 +778,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
@Override
public OrgPersonFormDto selectPersonByIdDetail(Long id) throws Exception {
OrgUsr orgUsr = getById(id);
// 动态表单数据
List<FormValue> formValue = getFormValueDetail(id);
OrgPersonFormDto orgPersonFormVo = new OrgPersonFormDto(formValue);
......@@ -788,6 +799,15 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
columnMap.put("is_delete", CommonConstant.IS_DELETE_00);
columnMap.put("biz_org_type", CommonConstant.BIZ_ORG_TYPE_PERSON);
Collection<OrgUsr> list = listByMap(columnMap);
// list.stream().forEach(t-> {
// // BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
// if(StringUtils.isNotEmpty(t.getAmosOrgId())) {
// FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(t.getAmosOrgId());
// if(null !=result1.getResult()) {
// t.setAmosOrgCode(result1.getResult().getRealName());
// }
// }
// });
return getTree(null, list, OrgUsr.class.getName(), "getSequenceNbr", 2, "getBizOrgName", "getParentId",
"getBizOrgType");
}
......@@ -1455,7 +1475,23 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return orgUsrList;
}
/**
* 重写getByid 方法 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
* @param id
* @return
*/
@Override
public OrgUsr getById(Serializable id) {
OrgUsr orgUser = this.baseMapper.selectById(id);
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm 2021-09-16
if(orgUser != null && StringUtils.isNotEmpty(orgUser.getAmosOrgId())) {
FeignClientResult<AgencyUserModel> result1 = Privilege.agencyUserClient.queryByUserId(orgUser.getAmosOrgId());
if(null !=result1.getResult()) {
orgUser.setAmosOrgCode(result1.getResult().getRealName());
}
}
return orgUser;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment