diff --git a/pom.xml b/pom.xml
index 9c8d578..d10e59a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -69,6 +69,12 @@
ink.wgink
login-app
1.0-SNAPSHOT
+
+
+ ink.wgink
+ module-dictionary
+
+
@@ -105,6 +111,18 @@
ink.wgink
login-oauth2-server
1.0-SNAPSHOT
+
+
+ ink.wgink
+ login-base
+
+
+
+
+
+ ink.wgink
+ mongo-module-dictionary
+ 1.0-SNAPSHOT
diff --git a/src/main/java/cn/com/tenlion/usercenter/controller/app/api/userexpand/UserExpandAppController.java b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/userexpand/UserExpandAppController.java
index 54a2812..bb91055 100644
--- a/src/main/java/cn/com/tenlion/usercenter/controller/app/api/userexpand/UserExpandAppController.java
+++ b/src/main/java/cn/com/tenlion/usercenter/controller/app/api/userexpand/UserExpandAppController.java
@@ -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);
+ }
+
}
\ No newline at end of file
diff --git a/src/main/java/cn/com/tenlion/usercenter/service/userexpand/IUserExpandService.java b/src/main/java/cn/com/tenlion/usercenter/service/userexpand/IUserExpandService.java
index bca73ea..5475c80 100644
--- a/src/main/java/cn/com/tenlion/usercenter/service/userexpand/IUserExpandService.java
+++ b/src/main/java/cn/com/tenlion/usercenter/service/userexpand/IUserExpandService.java
@@ -59,4 +59,11 @@ public interface IUserExpandService extends IUserExpandBaseService listWholeByRoleIdAndAreaCode(String roleId, String areaCode);
+ /**
+ * 详情全部
+ *
+ * @param userId
+ * @return
+ */
+ UserExpandDTO getWhole(String userId);
}
diff --git a/src/main/java/cn/com/tenlion/usercenter/service/userexpand/impl/UserExpandServiceImpl.java b/src/main/java/cn/com/tenlion/usercenter/service/userexpand/impl/UserExpandServiceImpl.java
index b024c44..68585ac 100644
--- a/src/main/java/cn/com/tenlion/usercenter/service/userexpand/impl/UserExpandServiceImpl.java
+++ b/src/main/java/cn/com/tenlion/usercenter/service/userexpand/impl/UserExpandServiceImpl.java
@@ -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 departmentUserDTOs = departmentUserBaseService.listByUserIds(Arrays.asList(userId));
+ if (departmentUserDTOs.isEmpty()) {
+ return userExpandDTO;
+ }
+ List departmentPOs = departmentBaseService.listPO(ArrayListUtil.listBeanStringIdValue(departmentUserDTOs, "departmentId", DepartmentUserDTO.class));
+ if (departmentPOs.isEmpty()) {
+ return userExpandDTO;
+ }
+ setDepartment(userExpandDTO, departmentUserDTOs, departmentPOs);
+ return userExpandDTO;
+ }
+
/**
* 设置用户
*
@@ -255,22 +275,33 @@ public class UserExpandServiceImpl extends DefaultBaseService implements IUserEx
}
// 合并内容
for (UserExpandDTO userExpandDTO : userExpandDTOs) {
- List departmentDTOs = new ArrayList<>();
- for (DepartmentUserDTO departmentUserDTO : departmentUserDTOs) {
- if (!StringUtils.equals(userExpandDTO.getUserId(), departmentUserDTO.getUserId())) {
- continue;
- }
- for (DepartmentPO departmentPO : departmentPOs) {
- if (!StringUtils.equals(departmentUserDTO.getDepartmentId(), departmentPO.getDepartmentId())) {
- continue;
- }
- DepartmentDTO departmentDTO = new DepartmentDTO();
- BeanUtils.copyProperties(departmentPO, departmentDTO);
- departmentDTOs.add(departmentDTO);
- break;
- }
- }
- userExpandDTO.setDepartments(departmentDTOs);
+ setDepartment(userExpandDTO, departmentUserDTOs, departmentPOs);
}
}
+
+ /**
+ * 设置部门
+ *
+ * @param userExpandDTO
+ * @param departmentUserDTOs
+ * @param departmentPOs
+ */
+ private void setDepartment(UserExpandDTO userExpandDTO, List departmentUserDTOs, List departmentPOs) {
+ List departmentDTOs = new ArrayList<>();
+ for (DepartmentUserDTO departmentUserDTO : departmentUserDTOs) {
+ if (!StringUtils.equals(userExpandDTO.getUserId(), departmentUserDTO.getUserId())) {
+ continue;
+ }
+ for (DepartmentPO departmentPO : departmentPOs) {
+ if (!StringUtils.equals(departmentUserDTO.getDepartmentId(), departmentPO.getDepartmentId())) {
+ continue;
+ }
+ DepartmentDTO departmentDTO = new DepartmentDTO();
+ BeanUtils.copyProperties(departmentPO, departmentDTO);
+ departmentDTOs.add(departmentDTO);
+ break;
+ }
+ }
+ userExpandDTO.setDepartments(departmentDTOs);
+ }
}
diff --git a/src/main/resources/templates/enterprise/save.html b/src/main/resources/templates/enterprise/save.html
index aeda5ee..12f085b 100644
--- a/src/main/resources/templates/enterprise/save.html
+++ b/src/main/resources/templates/enterprise/save.html
@@ -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;
});
diff --git a/src/main/resources/templates/enterprise/update.html b/src/main/resources/templates/enterprise/update.html
index eb7d446..194deb8 100644
--- a/src/main/resources/templates/enterprise/update.html
+++ b/src/main/resources/templates/enterprise/update.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;
});
diff --git a/src/main/resources/templates/organization/save.html b/src/main/resources/templates/organization/save.html
index 2cb44e7..f80c657 100644
--- a/src/main/resources/templates/organization/save.html
+++ b/src/main/resources/templates/organization/save.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;
});
diff --git a/src/main/resources/templates/organization/update.html b/src/main/resources/templates/organization/update.html
index 7df6621..ec23d62 100644
--- a/src/main/resources/templates/organization/update.html
+++ b/src/main/resources/templates/organization/update.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;
});