|
|
|
@ -1,22 +1,18 @@ |
|
|
|
package org.springblade.wms.service.impl; |
|
|
|
package org.springblade.wms.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
import jakarta.annotation.Resource; |
|
|
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
import org.springblade.system.feign.IUserClient; |
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
import org.springblade.system.pojo.entity.User; |
|
|
|
import org.springblade.wms.excel.StStorehouseExcel; |
|
|
|
import org.springblade.wms.excel.StStorehouseExcel; |
|
|
|
import org.springblade.wms.mapper.StGoodsClassMapper; |
|
|
|
|
|
|
|
import org.springblade.wms.mapper.StStorehouseMapper; |
|
|
|
import org.springblade.wms.mapper.StStorehouseMapper; |
|
|
|
import org.springblade.wms.pojo.entity.MesConstant; |
|
|
|
import org.springblade.wms.pojo.entity.MesConstant; |
|
|
|
import org.springblade.wms.pojo.entity.PfUserInfo; |
|
|
|
|
|
|
|
import org.springblade.wms.pojo.entity.StGoodsClass; |
|
|
|
|
|
|
|
import org.springblade.wms.pojo.entity.StStorehouse; |
|
|
|
import org.springblade.wms.pojo.entity.StStorehouse; |
|
|
|
import org.springblade.wms.pojo.vo.StStorehouseVO; |
|
|
|
import org.springblade.wms.pojo.vo.StStorehouseVO; |
|
|
|
import org.springblade.wms.service.IStStorehouseService; |
|
|
|
import org.springblade.wms.service.IStStorehouseService; |
|
|
|
@ -37,6 +33,7 @@ import java.util.List; |
|
|
|
public class StStorehouseServiceImpl extends BaseServiceImpl<StStorehouseMapper, StStorehouse> implements IStStorehouseService { |
|
|
|
public class StStorehouseServiceImpl extends BaseServiceImpl<StStorehouseMapper, StStorehouse> implements IStStorehouseService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
IUserClient userClient; |
|
|
|
IUserClient userClient; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<StStorehouseVO> selectStStorehousePage(IPage<StStorehouseVO> page, StStorehouseVO stStorehouse) { |
|
|
|
public IPage<StStorehouseVO> selectStStorehousePage(IPage<StStorehouseVO> page, StStorehouseVO stStorehouse) { |
|
|
|
return page.setRecords(baseMapper.selectStStorehousePage(page, stStorehouse)); |
|
|
|
return page.setRecords(baseMapper.selectStStorehousePage(page, stStorehouse)); |
|
|
|
@ -44,19 +41,19 @@ public class StStorehouseServiceImpl extends BaseServiceImpl<StStorehouseMapper, |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<StStorehouseVO> selectStorehousePage(IPage<StStorehouseVO> page, StStorehouseVO stStorehouse, Long userId, String urTypeStorehouse) { |
|
|
|
public IPage<StStorehouseVO> selectStorehousePage(IPage<StStorehouseVO> page, StStorehouseVO stStorehouse, Long userId, String urTypeStorehouse) { |
|
|
|
return page.setRecords(baseMapper.selectStorehousePage(page, stStorehouse,userId,urTypeStorehouse)); |
|
|
|
return page.setRecords(baseMapper.selectStorehousePage(page, stStorehouse, userId, urTypeStorehouse)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean checkName(Long id, String shName) { |
|
|
|
public Boolean checkName(Long id, String shName) { |
|
|
|
StStorehouse stStorehouse = baseMapper.checkName(id, shName); |
|
|
|
StStorehouse stStorehouse = baseMapper.checkName(id, shName); |
|
|
|
return stStorehouse!=null &&stStorehouse.getId()!=id; |
|
|
|
return stStorehouse != null && stStorehouse.getId() != id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean checkCode(Long id, String shCode) { |
|
|
|
public Boolean checkCode(Long id, String shCode) { |
|
|
|
StStorehouse stStorehouse = baseMapper.checkCode(id, shCode); |
|
|
|
StStorehouse stStorehouse = baseMapper.checkCode(id, shCode); |
|
|
|
return stStorehouse!=null &&stStorehouse.getId()!=id; |
|
|
|
return stStorehouse != null && stStorehouse.getId() != id; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@ -72,17 +69,17 @@ public class StStorehouseServiceImpl extends BaseServiceImpl<StStorehouseMapper, |
|
|
|
return rtnObj; |
|
|
|
return rtnObj; |
|
|
|
|
|
|
|
|
|
|
|
//指定人员未分配库房
|
|
|
|
//指定人员未分配库房
|
|
|
|
List<StStorehouse> noChooseList = this.findStorehouseList(userId, urType,false); |
|
|
|
List<StStorehouse> noChooseList = this.findStorehouseList(userId, urType, false); |
|
|
|
JSONArray noChooseArray = new JSONArray(); |
|
|
|
JSONArray noChooseArray = new JSONArray(); |
|
|
|
if(noChooseList != null && noChooseList.size() > 0){ |
|
|
|
if (noChooseList != null && noChooseList.size() > 0) { |
|
|
|
for(StStorehouse stStorehouse : noChooseList){ |
|
|
|
for (StStorehouse stStorehouse : noChooseList) { |
|
|
|
noChooseArray.add(this.stStorehouseToJSON(stStorehouse)); |
|
|
|
noChooseArray.add(this.stStorehouseToJSON(stStorehouse)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
rtnObj.put(MesConstant.TREE_NO_CHOOSE, noChooseArray); |
|
|
|
rtnObj.put(MesConstant.TREE_NO_CHOOSE, noChooseArray); |
|
|
|
|
|
|
|
|
|
|
|
//指定人员选中库房
|
|
|
|
//指定人员选中库房
|
|
|
|
List<StStorehouse> chooseList = this.findStorehouseList(userId, urType,true); |
|
|
|
List<StStorehouse> chooseList = this.findStorehouseList(userId, urType, true); |
|
|
|
JSONArray chooseArray = new JSONArray(); |
|
|
|
JSONArray chooseArray = new JSONArray(); |
|
|
|
if (chooseList != null && chooseList.size() > 0) { |
|
|
|
if (chooseList != null && chooseList.size() > 0) { |
|
|
|
for (StStorehouse storehouse : chooseList) { |
|
|
|
for (StStorehouse storehouse : chooseList) { |
|
|
|
@ -108,10 +105,10 @@ public class StStorehouseServiceImpl extends BaseServiceImpl<StStorehouseMapper, |
|
|
|
R<User> ruser = userClient.userInfoById(userId); |
|
|
|
R<User> ruser = userClient.userInfoById(userId); |
|
|
|
User user = ruser.getData(); |
|
|
|
User user = ruser.getData(); |
|
|
|
//查询已选中库房
|
|
|
|
//查询已选中库房
|
|
|
|
if(choose){ |
|
|
|
if (choose) { |
|
|
|
return baseMapper.findStorehouseList(user.getId(), urType,true); |
|
|
|
return baseMapper.findStorehouseList(user.getId(), urType, true); |
|
|
|
}else{//查询未选中库房
|
|
|
|
} else {//查询未选中库房
|
|
|
|
return baseMapper.findStorehouseList(user.getId(), urType,false); |
|
|
|
return baseMapper.findStorehouseList(user.getId(), urType, false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|