|
|
@@ -23,7 +23,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.client.entity.BasicContainerDesc;
|
|
|
import org.springblade.client.entity.BasicPortDesc;
|
|
|
-import org.springblade.client.entity.CorpsDesc;
|
|
|
import org.springblade.client.feign.IContainerDescClient;
|
|
|
import org.springblade.client.feign.ICorpsDescClient;
|
|
|
import org.springblade.client.feign.IPortClient;
|
|
|
@@ -44,6 +43,7 @@ import org.springblade.los.box.mapper.ArchivesMapper;
|
|
|
import org.springblade.los.box.mapper.TradingBoxMapper;
|
|
|
import org.springblade.los.box.service.IArchivesService;
|
|
|
import org.springblade.los.box.vo.ArchivesVO;
|
|
|
+import org.springblade.system.feign.ISysClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
@@ -74,6 +74,8 @@ public class ArchivesServiceImpl extends ServiceImpl<ArchivesMapper, Archives> i
|
|
|
|
|
|
private final IBPortsService bPortsService;
|
|
|
|
|
|
+ private final ISysClient sysClient;
|
|
|
+
|
|
|
@Override
|
|
|
public IPage<ArchivesVO> selectArchivesPage(IPage<ArchivesVO> page, ArchivesVO archives) {
|
|
|
return page.setRecords(baseMapper.selectArchivesPage(page, archives));
|
|
|
@@ -179,17 +181,46 @@ public class ArchivesServiceImpl extends ServiceImpl<ArchivesMapper, Archives> i
|
|
|
.eq(BPorts::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(BPorts::getIsDeleted, 0)
|
|
|
.in(BPorts::getCnName, portsList));
|
|
|
+ String blacklist = sysClient.getParamService("box.blacklist");
|
|
|
+ StringBuilder textCode = new StringBuilder();
|
|
|
+ StringBuilder textContainerNumber = new StringBuilder();
|
|
|
+ StringBuilder textType = new StringBuilder();
|
|
|
+ StringBuilder text = new StringBuilder();
|
|
|
for (ArchivesExcelEnter archivesExcelEnter : excelList) {
|
|
|
- Archives archives = new Archives();
|
|
|
if (ObjectUtils.isNull(archivesExcelEnter.getCode())) {
|
|
|
- throw new RuntimeException("箱号不能为空");
|
|
|
+ textCode.append(archivesExcelEnter.getCode()).append(",");
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(blacklist)) {
|
|
|
+ if (archivesExcelEnter.getCode().length() > 3) {
|
|
|
+ String head = archivesExcelEnter.getCode().substring(0, 4);
|
|
|
+ if (blacklist.contains(head)) {
|
|
|
+ text.append(archivesExcelEnter.getTypeName()).append(",");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
if (ObjectUtils.isNull(archivesExcelEnter.getContainerNumber())) {
|
|
|
+ textContainerNumber.append(archivesExcelEnter.getContainerNumber()).append(",");
|
|
|
throw new RuntimeException("放箱号不能为空");
|
|
|
}
|
|
|
if (ObjectUtils.isNull(archivesExcelEnter.getTypeName())) {
|
|
|
+ textType.append(archivesExcelEnter.getTypeName()).append(",");
|
|
|
throw new RuntimeException("箱型不能为空");
|
|
|
}
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(textCode)) {
|
|
|
+ throw new RuntimeException("箱号:" + textCode + "不能为空");
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(textContainerNumber)) {
|
|
|
+ throw new RuntimeException("箱号:" + textContainerNumber + "放箱号不能为空");
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(textType)) {
|
|
|
+ throw new RuntimeException("箱号:" + textType + "箱型不能为空");
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotNull(text)) {
|
|
|
+ throw new RuntimeException("箱号:" + text + "为黑名单箱,请修改数据后再操作");
|
|
|
+ }
|
|
|
+ for (ArchivesExcelEnter archivesExcelEnter : excelList) {
|
|
|
+ Archives archives = new Archives();
|
|
|
BeanUtil.copy(archivesExcelEnter, archives);
|
|
|
//港口
|
|
|
if (ObjectUtils.isNotNull(archives.getAddressCname())) {
|