Showing
2 changed files
with
16 additions
and
20 deletions
xingyun-sc/src/main/java/com/lframework/xingyun/sc/controller/customer/CustomerCreditController.java
| @@ -215,7 +215,7 @@ public class CustomerCreditController extends DefaultBaseController { | @@ -215,7 +215,7 @@ public class CustomerCreditController extends DefaultBaseController { | ||
| 215 | } | 215 | } |
| 216 | 216 | ||
| 217 | /** | 217 | /** |
| 218 | - * 获取当前人下部门所有人 | 218 | + * 获取当前人下部门所有人包含子部门 |
| 219 | */ | 219 | */ |
| 220 | @ApiOperation("获取当前人下部门所有人") | 220 | @ApiOperation("获取当前人下部门所有人") |
| 221 | @GetMapping("/getAllUser") | 221 | @GetMapping("/getAllUser") |
| @@ -17,6 +17,7 @@ import com.lframework.starter.web.inner.bo.system.user.GetSysUserBo; | @@ -17,6 +17,7 @@ import com.lframework.starter.web.inner.bo.system.user.GetSysUserBo; | ||
| 17 | import com.lframework.starter.web.inner.entity.SysDept; | 17 | import com.lframework.starter.web.inner.entity.SysDept; |
| 18 | import com.lframework.starter.web.inner.entity.SysUser; | 18 | import com.lframework.starter.web.inner.entity.SysUser; |
| 19 | import com.lframework.starter.web.inner.service.system.SysDeptService; | 19 | import com.lframework.starter.web.inner.service.system.SysDeptService; |
| 20 | +import com.lframework.starter.web.inner.service.system.SysUserDeptService; | ||
| 20 | import com.lframework.starter.web.inner.service.system.SysUserService; | 21 | import com.lframework.starter.web.inner.service.system.SysUserService; |
| 21 | import com.lframework.starter.web.inner.vo.system.user.QuerySysUserVo; | 22 | import com.lframework.starter.web.inner.vo.system.user.QuerySysUserVo; |
| 22 | import com.lframework.xingyun.sc.bo.customer.credit.GetCorePersonnelBo; | 23 | import com.lframework.xingyun.sc.bo.customer.credit.GetCorePersonnelBo; |
| @@ -91,6 +92,8 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | @@ -91,6 +92,8 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | ||
| 91 | private RedisHandler redisHandler; | 92 | private RedisHandler redisHandler; |
| 92 | @Resource | 93 | @Resource |
| 93 | private FlowTaskWrapperMapper flowTaskWrapperMapper; | 94 | private FlowTaskWrapperMapper flowTaskWrapperMapper; |
| 95 | + @Resource | ||
| 96 | + private SysUserDeptService sysUserDeptService; | ||
| 94 | 97 | ||
| 95 | @Override | 98 | @Override |
| 96 | public PageResult<CustomerCredit> query(Integer pageIndex, Integer pageSize, QueryCustomerCreditVo vo) { | 99 | public PageResult<CustomerCredit> query(Integer pageIndex, Integer pageSize, QueryCustomerCreditVo vo) { |
| @@ -1143,28 +1146,19 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | @@ -1143,28 +1146,19 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | ||
| 1143 | /** | 1146 | /** |
| 1144 | * 获取当前人下部门所有人 | 1147 | * 获取当前人下部门所有人 |
| 1145 | * | 1148 | * |
| 1146 | - * @return 获取当前人下部门所有人 | 1149 | + * @return 获取当前人下部门所有人包含子部门 |
| 1147 | */ | 1150 | */ |
| 1148 | @Override | 1151 | @Override |
| 1149 | public List<SysUser> getAllUser() { | 1152 | public List<SysUser> getAllUser() { |
| 1150 | //获取当前人员ID | 1153 | //获取当前人员ID |
| 1151 | String currentUserId = SecurityUtil.getCurrentUser().getId(); | 1154 | String currentUserId = SecurityUtil.getCurrentUser().getId(); |
| 1152 | - SysUser sysUser = sysUserService.findById(currentUserId); | ||
| 1153 | - if (sysUser != null) { | ||
| 1154 | - GetSysUserBo getSysUserBo = new GetSysUserBo(sysUser); | ||
| 1155 | - //部门 | ||
| 1156 | - List<String> depts = getSysUserBo.getDepts(); | ||
| 1157 | - if (CollectionUtils.isNotEmpty(depts)) { | ||
| 1158 | - String deptId = depts.get(0); | ||
| 1159 | - QuerySysUserVo vo = new QuerySysUserVo(); | ||
| 1160 | - vo.setDeptId(deptId); | ||
| 1161 | - return sysUserService.query(vo); | ||
| 1162 | - } else { | ||
| 1163 | - throw new IllegalArgumentException("部门名称为空"); | ||
| 1164 | - } | ||
| 1165 | - } else { | ||
| 1166 | - throw new IllegalArgumentException("人员不存在"); | ||
| 1167 | - } | 1155 | + List<String> userIdList = new ArrayList<>(); |
| 1156 | + userIdList.add(currentUserId); | ||
| 1157 | + | ||
| 1158 | + Map<String, List<String>> userIdMap = sysUserDeptService.mapAllUserByUserId(userIdList, true); | ||
| 1159 | + List<String> userIds = userIdMap.get(currentUserId); | ||
| 1160 | + | ||
| 1161 | + return sysUserService.listByUserId(userIds); | ||
| 1168 | } | 1162 | } |
| 1169 | 1163 | ||
| 1170 | /** | 1164 | /** |
| @@ -1283,10 +1277,12 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | @@ -1283,10 +1277,12 @@ public class CustomerCreditServiceImpl extends BaseMpServiceImpl<CustomerCreditM | ||
| 1283 | } | 1277 | } |
| 1284 | if (StringUtil.isNotEmpty(data.getEnterpriseType())) { | 1278 | if (StringUtil.isNotEmpty(data.getEnterpriseType())) { |
| 1285 | String enterpriseType; | 1279 | String enterpriseType; |
| 1286 | - if ("DISTRIBUTOR".equals(data.getEnterpriseType())) { | 1280 | + if ("DEALER".equals(data.getEnterpriseType())) { |
| 1287 | enterpriseType = "经销商"; | 1281 | enterpriseType = "经销商"; |
| 1288 | - } else { | 1282 | + } else if ("TERMINAL".equals(data.getEnterpriseType())) { |
| 1289 | enterpriseType = "终端"; | 1283 | enterpriseType = "终端"; |
| 1284 | + } else { | ||
| 1285 | + enterpriseType = data.getEnterpriseType(); | ||
| 1290 | } | 1286 | } |
| 1291 | dataModel.put("enterpriseType", enterpriseType); | 1287 | dataModel.put("enterpriseType", enterpriseType); |
| 1292 | } | 1288 | } |