|
@ -1,4 +1,4 @@ |
|
|
package org.nl.wms.basedata.st.areapermissions.service.impl; |
|
|
package org.nl.wms.basedata.st.userarea.service.impl; |
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONArray; |
|
@ -11,14 +11,13 @@ import org.nl.common.domain.query.PageQuery; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.common.utils.SecurityUtils; |
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.modules.wql.core.bean.WQLObject; |
|
|
import org.nl.modules.wql.core.bean.WQLObject; |
|
|
import org.nl.wms.basedata.st.areapermissions.service.IUserAreaPermissionService; |
|
|
import org.nl.wms.basedata.st.userarea.service.IUserAreaPermissionService; |
|
|
import org.nl.wms.basedata.st.areapermissions.service.dao.UserAreaPermission; |
|
|
import org.nl.wms.basedata.st.userarea.service.dao.UserAreaPermission; |
|
|
import org.nl.wms.basedata.st.areapermissions.service.dao.mapper.UserAreaPermissionMapper; |
|
|
import org.nl.wms.basedata.st.userarea.service.dao.mapper.UserAreaPermissionMapper; |
|
|
import org.nl.wms.basedata.st.areapermissions.service.vo.UsersVo; |
|
|
import org.nl.wms.basedata.st.userarea.service.vo.UsersVo; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
import java.util.LinkedList; |
|
|
import java.util.LinkedList; |
|
|
import java.util.List; |
|
|
import java.util.List; |
|
|
import java.util.Map; |
|
|
import java.util.Map; |
|
@ -71,30 +70,28 @@ public class UserAreaPermissionServiceImpl extends ServiceImpl<UserAreaPermissio |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public String getInArea() { |
|
|
public String getInArea() { |
|
|
String currentUserId = SecurityUtils.getCurrentUserId().toString(); |
|
|
String currentUserId = SecurityUtils.getCurrentUserId(); |
|
|
WQLObject userStorTab = WQLObject.getWQLObject("st_ivt_userarea"); |
|
|
List<UserAreaPermission> userStorArr = userAreaPermissionMapper.selectList(new LambdaQueryWrapper<UserAreaPermission>() |
|
|
|
|
|
.eq(UserAreaPermission::getUser_id, currentUserId)); |
|
|
JSONArray userStorArr = userStorTab.query("user_id = '" + currentUserId + "'").getResultJSONArray(0); |
|
|
|
|
|
int size = userStorArr.size(); |
|
|
|
|
|
// 将仓库id拼成字符串
|
|
|
// 将仓库id拼成字符串
|
|
|
String in_stor_id = ""; |
|
|
String in_stor_id = ""; |
|
|
|
|
|
int size = userStorArr.size(); |
|
|
for (int i = 0; i < userStorArr.size(); i++) { |
|
|
for (int i = 0; i < userStorArr.size(); i++) { |
|
|
JSONObject json = userStorArr.getJSONObject(i); |
|
|
UserAreaPermission json = userStorArr.get(i); |
|
|
|
|
|
|
|
|
if (size == 1) { |
|
|
if (size == 1) { |
|
|
// 如果只有一条记录
|
|
|
// 如果只有一条记录
|
|
|
in_stor_id = "('" + json.getString("product_area") + "')"; |
|
|
in_stor_id = "('" + json.getProduct_area() + "')"; |
|
|
} else { |
|
|
} else { |
|
|
if (i == 0) { |
|
|
if (i == 0) { |
|
|
// 第一条记录拼接
|
|
|
// 第一条记录拼接
|
|
|
in_stor_id = "('" + json.getString("product_area") + "','"; |
|
|
in_stor_id = "('" + json.getProduct_area()+ "','"; |
|
|
} else { |
|
|
} else { |
|
|
if ((size - 1) == i) { |
|
|
if ((size - 1) == i) { |
|
|
// 最后一条记录拼接
|
|
|
// 最后一条记录拼接
|
|
|
in_stor_id += json.getString("product_area") + "')"; |
|
|
in_stor_id += json.getProduct_area() + "')"; |
|
|
} else { |
|
|
} else { |
|
|
in_stor_id += json.getString("product_area") + "','"; |
|
|
in_stor_id += json.getProduct_area() + "','"; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |