|
|
|
@ -3,7 +3,7 @@ package com.glxp.api.service.auth.impl;
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.glxp.api.dao.auth.InvSubWarehouseDao;
|
|
|
|
|
import com.glxp.api.dao.auth.InvWarehouseDao;
|
|
|
|
|
import com.glxp.api.dao.thrsys.ThrSystemDao;
|
|
|
|
|
import com.glxp.api.entity.auth.InvWarehouseEntity;
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrSystemEntity;
|
|
|
|
@ -25,7 +25,7 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
InvSubWarehouseDao invSubWarehouseDao;
|
|
|
|
|
InvWarehouseDao invWarehouseDao;
|
|
|
|
|
@Resource
|
|
|
|
|
private ThrSystemDao thrSystemDao;
|
|
|
|
|
|
|
|
|
@ -33,7 +33,7 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
public InvWarehouseEntity findById(String id) {
|
|
|
|
|
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
|
|
|
|
|
filterInvSubWarehouseRequest.setId(id);
|
|
|
|
|
List<InvWarehouseEntity> data = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
List<InvWarehouseEntity> data = invWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(data)) {
|
|
|
|
|
return data.get(0);
|
|
|
|
|
}
|
|
|
|
@ -49,7 +49,7 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
int offset = (filterInvSubWarehouseRequest.getPage() - 1) * filterInvSubWarehouseRequest.getLimit();
|
|
|
|
|
PageHelper.offsetPage(offset, filterInvSubWarehouseRequest.getLimit());
|
|
|
|
|
}
|
|
|
|
|
List<InvWarehouseEntity> data = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
List<InvWarehouseEntity> data = invWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -62,20 +62,20 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
int offset = (filterInvWarehouseRequest.getPage() - 1) * filterInvWarehouseRequest.getLimit();
|
|
|
|
|
PageHelper.offsetPage(offset, filterInvWarehouseRequest.getLimit());
|
|
|
|
|
}
|
|
|
|
|
List<InvWarehouseEntity> data = invSubWarehouseDao.filterGroupInvSub(filterInvWarehouseRequest);
|
|
|
|
|
List<InvWarehouseEntity> data = invWarehouseDao.filterGroupInvSub(filterInvWarehouseRequest);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public InvWarehouseEntity selectMaxCode(FilterInvSubWarehouseRequest filterInvSubWarehouseRequest) {
|
|
|
|
|
return invSubWarehouseDao.selectMaxCode(filterInvSubWarehouseRequest);
|
|
|
|
|
return invWarehouseDao.selectMaxCode(filterInvSubWarehouseRequest);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InvWarehouseEntity> findByParentId(String code) {
|
|
|
|
|
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
|
|
|
|
|
filterInvSubWarehouseRequest.setParentId(code);
|
|
|
|
|
List<InvWarehouseEntity> invSubWarehouseEntities = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
return invSubWarehouseEntities;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -85,7 +85,7 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
return null;
|
|
|
|
|
FilterInvSubWarehouseRequest filterInvSubWarehouseRequest = new FilterInvSubWarehouseRequest();
|
|
|
|
|
filterInvSubWarehouseRequest.setCode(code);
|
|
|
|
|
List<InvWarehouseEntity> invSubWarehouseEntities = invSubWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
List<InvWarehouseEntity> invSubWarehouseEntities = invWarehouseDao.filterInvSubWarehouse(filterInvSubWarehouseRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(invSubWarehouseEntities)) {
|
|
|
|
|
return invSubWarehouseEntities.get(0);
|
|
|
|
|
}
|
|
|
|
@ -94,27 +94,27 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean insertInvSubWarehouse(InvWarehouseEntity invWarehouseEntity) {
|
|
|
|
|
return invSubWarehouseDao.insertInvSubWarehouse(invWarehouseEntity);
|
|
|
|
|
return invWarehouseDao.insertInvSubWarehouse(invWarehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean updateInvSubWarehouse(InvWarehouseEntity invWarehouseEntity) {
|
|
|
|
|
return invSubWarehouseDao.updateInvSubWarehouse(invWarehouseEntity);
|
|
|
|
|
return invWarehouseDao.updateInvSubWarehouse(invWarehouseEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean deleteById(String id) {
|
|
|
|
|
return invSubWarehouseDao.deleteById(id);
|
|
|
|
|
return invWarehouseDao.deleteById(id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean deleteByParentCode(String code) {
|
|
|
|
|
return invSubWarehouseDao.deleteByParentCode(code);
|
|
|
|
|
return invWarehouseDao.deleteByParentCode(code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean checkDuplicateName(String parentId, String name) {
|
|
|
|
|
int count = invSubWarehouseDao.countByParentIdAndName(parentId, name);
|
|
|
|
|
int count = invWarehouseDao.countByParentIdAndName(parentId, name);
|
|
|
|
|
if (count > 0) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -126,7 +126,7 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
if (StrUtil.isBlank(subInvCode)) {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
return invSubWarehouseDao.selectNameByCode(subInvCode);
|
|
|
|
|
return invWarehouseDao.selectNameByCode(subInvCode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -138,7 +138,7 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
return null;
|
|
|
|
|
FilterInvSubWarehouseRequest tempReqeust = new FilterInvSubWarehouseRequest();
|
|
|
|
|
tempReqeust.setCode(id);
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invSubWarehouseDao.selectJoinThirdSys(tempReqeust);
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectJoinThirdSys(tempReqeust);
|
|
|
|
|
List<InvWarehouseThirdSysResponse> invWarehouseThirdSysResponses = new ArrayList<>();
|
|
|
|
|
for (ThrSystemEntity sys : data) {
|
|
|
|
|
InvWarehouseThirdSysResponse invWarehouseThirdSysResponse = new InvWarehouseThirdSysResponse();
|
|
|
|
@ -170,13 +170,13 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean bindThrWarehouse(String id, String thridWarehouseId, String sysId) {
|
|
|
|
|
return invSubWarehouseDao.updateThridId(id, thridWarehouseId, sysId);
|
|
|
|
|
return invWarehouseDao.updateThridId(id, thridWarehouseId, sysId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean unbindThrWarehouse(String id, String sysId) {
|
|
|
|
|
|
|
|
|
|
return invSubWarehouseDao.updateThridId(id, null, sysId);
|
|
|
|
|
return invWarehouseDao.updateThridId(id, null, sysId);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -189,27 +189,27 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
|
|
|
|
|
int offset = (filterInvSubWarehouseRequest.getPage() - 1) * filterInvSubWarehouseRequest.getLimit();
|
|
|
|
|
PageHelper.offsetPage(offset, filterInvSubWarehouseRequest.getLimit());
|
|
|
|
|
}
|
|
|
|
|
List<InvSubWarehouseResponse> data = invSubWarehouseDao.filterInvSubWarehouseResponse(filterInvSubWarehouseRequest);
|
|
|
|
|
List<InvSubWarehouseResponse> data = invWarehouseDao.filterInvSubWarehouseResponse(filterInvSubWarehouseRequest);
|
|
|
|
|
return data;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public InvWarehouseEntity filterGroupInvSubAndcode(String code) {
|
|
|
|
|
return invSubWarehouseDao.filterGroupInvSubAndcode(code);
|
|
|
|
|
return invWarehouseDao.filterGroupInvSubAndcode(code);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InvWarehouseEntity> filterGroupInvSubDown(FilterInvWarehouseRequest filterInvSubWarehouseRequest) {
|
|
|
|
|
return invSubWarehouseDao.filterGroupInvSubDown(filterInvSubWarehouseRequest);
|
|
|
|
|
return invWarehouseDao.filterGroupInvSubDown(filterInvSubWarehouseRequest);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InvSubWarehouseResponse> filterSubInvList(FilterInvWarehouseRequest filterInvWarehouseRequest) {
|
|
|
|
|
return invSubWarehouseDao.filterSubInvList(filterInvWarehouseRequest);
|
|
|
|
|
return invWarehouseDao.filterSubInvList(filterInvWarehouseRequest);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<InvWarehouseEntity> findInvListByUser(Long userId) {
|
|
|
|
|
return invSubWarehouseDao.selectInvListByUser(userId);
|
|
|
|
|
return invWarehouseDao.selectInvListByUser(userId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|