添加数据字典mongo模块,增加兔展属性全部详情接口
This commit is contained in:
parent
f63a315c28
commit
6b8bb6c308
18
pom.xml
18
pom.xml
@ -69,6 +69,12 @@
|
||||
<groupId>ink.wgink</groupId>
|
||||
<artifactId>login-app</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ink.wgink</groupId>
|
||||
<artifactId>module-dictionary</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -105,6 +111,18 @@
|
||||
<groupId>ink.wgink</groupId>
|
||||
<artifactId>login-oauth2-server</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>ink.wgink</groupId>
|
||||
<artifactId>login-base</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ink.wgink</groupId>
|
||||
<artifactId>mongo-module-dictionary</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
</dependency>
|
||||
|
||||
<!-- mongodb start -->
|
||||
|
@ -49,4 +49,14 @@ public class UserExpandAppController extends DefaultBaseController {
|
||||
return userExpandService.get(userId);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "拓展属性(全部)详情", notes = "拓展属性(全部)详情接口")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "userId", value = "用户ID", paramType = "path")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("get-whole/{userId}")
|
||||
public UserExpandDTO getWhole(@PathVariable("userId") String userId) {
|
||||
return userExpandService.getWhole(userId);
|
||||
}
|
||||
|
||||
}
|
@ -59,4 +59,11 @@ public interface IUserExpandService extends IUserExpandBaseService<UserExpandDTO
|
||||
*/
|
||||
List<UserExpandDTO> listWholeByRoleIdAndAreaCode(String roleId, String areaCode);
|
||||
|
||||
/**
|
||||
* 详情全部
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
UserExpandDTO getWhole(String userId);
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -191,6 +192,25 @@ public class UserExpandServiceImpl extends DefaultBaseService implements IUserEx
|
||||
return userExpandDTOs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserExpandDTO getWhole(String userId) {
|
||||
UserExpandDTO userExpandDTO = get(userId);
|
||||
if (userExpandDTO == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
List<DepartmentUserDTO> departmentUserDTOs = departmentUserBaseService.listByUserIds(Arrays.asList(userId));
|
||||
if (departmentUserDTOs.isEmpty()) {
|
||||
return userExpandDTO;
|
||||
}
|
||||
List<DepartmentPO> departmentPOs = departmentBaseService.listPO(ArrayListUtil.listBeanStringIdValue(departmentUserDTOs, "departmentId", DepartmentUserDTO.class));
|
||||
if (departmentPOs.isEmpty()) {
|
||||
return userExpandDTO;
|
||||
}
|
||||
setDepartment(userExpandDTO, departmentUserDTOs, departmentPOs);
|
||||
return userExpandDTO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置用户
|
||||
*
|
||||
@ -255,6 +275,18 @@ public class UserExpandServiceImpl extends DefaultBaseService implements IUserEx
|
||||
}
|
||||
// 合并内容
|
||||
for (UserExpandDTO userExpandDTO : userExpandDTOs) {
|
||||
setDepartment(userExpandDTO, departmentUserDTOs, departmentPOs);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置部门
|
||||
*
|
||||
* @param userExpandDTO
|
||||
* @param departmentUserDTOs
|
||||
* @param departmentPOs
|
||||
*/
|
||||
private void setDepartment(UserExpandDTO userExpandDTO, List<DepartmentUserDTO> departmentUserDTOs, List<DepartmentPO> departmentPOs) {
|
||||
List<DepartmentDTO> departmentDTOs = new ArrayList<>();
|
||||
for (DepartmentUserDTO departmentUserDTO : departmentUserDTOs) {
|
||||
if (!StringUtils.equals(userExpandDTO.getUserId(), departmentUserDTO.getUserId())) {
|
||||
@ -273,4 +305,3 @@ public class UserExpandServiceImpl extends DefaultBaseService implements IUserEx
|
||||
userExpandDTO.setDepartments(departmentDTOs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -660,7 +660,7 @@
|
||||
|
||||
// 初始化证件类型ID下拉选择
|
||||
function initLegalPersonIdCardCodeSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/d3cbf2d8-d3b7-4530-b1e1-f2b35996999c', []), {}, null, function(code, data, args) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('legalPersonIdCardCodeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('legalPersonIdCardCodeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
|
@ -666,7 +666,7 @@
|
||||
|
||||
// 初始化类型ID下拉选择
|
||||
function initLegalPersonIdCardCodeSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/d3cbf2d8-d3b7-4530-b1e1-f2b35996999c', []), {}, null, function(code, data, args) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('legalPersonIdCardCodeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('legalPersonIdCardCodeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
|
@ -598,7 +598,7 @@
|
||||
}
|
||||
|
||||
function initMasterIdCardCodeSelect() {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/d3cbf2d8-d3b7-4530-b1e1-f2b35996999c', []), {}, null, function(code, data, args) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('masterIdCardCodeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('masterIdCardCodeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
|
@ -604,7 +604,7 @@
|
||||
}
|
||||
|
||||
function initMasterIdCardCodeSelect(selectValue) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/d3cbf2d8-d3b7-4530-b1e1-f2b35996999c', []), {}, null, function(code, data, args) {
|
||||
top.restAjax.get(top.restAjax.path('api/data/listbyparentid/76c5044f-805a-4313-b1e8-79e966b97c0d', []), {}, null, function(code, data, args) {
|
||||
laytpl(document.getElementById('masterIdCardCodeSelectTemplate').innerHTML).render(data, function(html) {
|
||||
document.getElementById('masterIdCardCodeSelectTemplateBox').innerHTML = html;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user