Procházet zdrojové kódy

1.调箱进场同步接口增加箱明细同步返回调箱单据中逻辑
2.调箱单据增加单据是否完成状态
3.转单POD场站必填项判断去掉
4.箱管调箱增加明细导入
5.单据锁增加公司权限区分

纪新园 před 1 měsícem
rodič
revize
4c86f92989

+ 92 - 0
blade-service-api/blade-los-api/src/main/java/org/springblade/los/box/excel/TransferBoxExcel.java

@@ -0,0 +1,92 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.los.box.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class TransferBoxExcel implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 箱号
+	 */
+	@ExcelProperty(value = "箱号*")
+	private String code;
+	/**
+	 * 箱类型
+	 */
+	@ExcelProperty(value = "箱型*")
+	private String boxType;
+	/**
+	 * 箱种类
+	 */
+	@ExcelProperty(value = "箱种类")
+	private String boxCategory;
+
+	/**
+	 * 箱好坏
+	 */
+	@ExcelProperty(value = "箱好坏*")
+	private String boxStatus;
+	/**
+	 * 箱况
+	 */
+	@ExcelProperty(value = "箱况(新/旧)*")
+	private String boxCondition;
+
+	/**
+	 * 场站
+	 */
+	@ExcelProperty(value = "场站*")
+	private String stationCname;
+	/**
+	 * 进场日期
+	 */
+	@ExcelProperty(value = "进场日期")
+	private String polPickUpDate;
+	/**
+	 * 出场日期
+	 */
+	@ExcelProperty(value = "出场日期")
+	private String polStationEmptyContainerExitDate;
+
+	/**
+	 * 备注
+	 */
+	@ExcelProperty(value = "备注")
+	private String remarks;
+
+
+}

+ 5 - 0
blade-service/blade-client/src/main/java/org/springblade/client/lock/controller/LockController.java

@@ -77,6 +77,9 @@ public class LockController extends BladeController {
 	@ApiOperation(value = "分页", notes = "传入lock")
 	public R<IPage<Lock>> list(Lock lock, Query query) {
 		lock.setTenantId(SecureUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			lock.setCreateDept(Long.parseLong(AuthUtil.getDeptId()));
+		}
 		IPage<Lock> pages = lockService.page(Condition.getPage(query), Condition.getQueryWrapper(lock));
 		return R.data(pages);
 	}
@@ -205,6 +208,7 @@ public class LockController extends BladeController {
 		LambdaQueryWrapper<Lock> lockLambdaQueryWrapper=new LambdaQueryWrapper<>();
 		lockLambdaQueryWrapper
 			.eq(Lock::getBillId,billId)
+			.eq(Lock::getCreateDept,AuthUtil.getDeptId())
 			.eq(Lock::getMoudleName,moduleName)
 			.eq(Lock::getTableName,tableName)
 			.eq(Lock::getTenantId,AuthUtil.getTenantId());
@@ -238,6 +242,7 @@ public class LockController extends BladeController {
 		{
 			Lock lock=new Lock();
 			lock.setUserId(AuthUtil.getUserId());
+			lock.setCreateDept(Long.parseLong(AuthUtil.getDeptId()));
 			lock.setRealName(AuthUtil.getUserName());
 			lock.setLockTime(new Date());
 			lock.setMoudleName(moduleName);

+ 2 - 1
blade-service/blade-los/src/main/java/org/springblade/los/box/controller/TradingBoxItemController.java

@@ -46,6 +46,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
 import javax.validation.Valid;
+import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -291,7 +292,7 @@ public class TradingBoxItemController extends BladeController {
 	@PostMapping("/importBoxItem")
 	@RepeatSubmit
 	public R importBoxItem(@RequestParam("file") MultipartFile file, @RequestParam("id") Long id,
-						   @RequestParam("type") String type) {
+						   @RequestParam("type") String type) throws ParseException {
 		return tradingBoxItemService.importBoxItem(file, id,type);
 	}
 

+ 89 - 89
blade-service/blade-los/src/main/java/org/springblade/los/box/dynamics/service/impl/BoxDynamicsRecordServiceImpl.java

@@ -778,8 +778,8 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					tradingBoxItemService.saveOrUpdateBatch(tradingBoxItems);
 				}
 			}*/
-			if (!itemsListJC.isEmpty()){
-				for (BoxDynamicsRecordItems item : itemsListJC){
+			if (!itemsListJC.isEmpty()) {
+				for (BoxDynamicsRecordItems item : itemsListJC) {
 					item.setTenantId(AuthUtil.getTenantId());
 				}
 				this.synchronization(itemsListJC);
@@ -1409,6 +1409,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
 						.eq(TradingBox::getTenantId, AuthUtil.getTenantId())
 						.eq(TradingBox::getIsDeleted, 0)
+						.eq(TradingBox::getStatus, 0)
 						.in(TradingBox::getId, srcIdList));
 				}
 				List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
@@ -1554,95 +1555,55 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 							putBoxItem.setBoxEastName(putBox.getBoxEastName());
 						}
 						putBoxItems.add(putBoxItem);
-						if ("OW(拿),OW(放)".contains(putBox.getBusType())) {
-							if (!tradingBoxList.isEmpty()) {
-								TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox.getSrcId()))
-									.findFirst().orElse(null);
-								if (tradingBox != null) {
-									if (!tradingBoxes.isEmpty()) {
-										if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
-											tradingBoxes.add(tradingBox);
-										}
-									} else {
+						if (!tradingBoxList.isEmpty()) {
+							TradingBox tradingBox = tradingBoxList.stream().filter(e -> e.getId().equals(putBox.getSrcId()))
+								.findFirst().orElse(null);
+							if (tradingBox != null) {
+								if (!tradingBoxes.isEmpty()) {
+									if (!tradingBoxes.stream().map(TradingBox::getId).collect(Collectors.toList()).contains(tradingBox.getId())) {
 										tradingBoxes.add(tradingBox);
 									}
-									TradingBoxItem tradingBoxItem;
-									if (!tradingBoxItemList.isEmpty()) {
-										tradingBoxItem = tradingBoxItemList.stream().filter(e -> e.getCode().equals(item.getBoxCode()))
-											.findFirst().orElse(null);
-										if (tradingBoxItem != null) {
-											tradingBoxItem.setPid(tradingBox.getId());
-											tradingBoxItem.setBoxDynamics("调箱进场");
-											tradingBoxItem.setPortId(item.getPortId());
-											tradingBoxItem.setPortCode(item.getPortCode());
-											tradingBoxItem.setPortCname(item.getPortCname());
-											tradingBoxItem.setPortEname(item.getPortEname());
-											tradingBoxItem.setStationId(item.getStationId());
-											tradingBoxItem.setStationCode(item.getStationCode());
-											tradingBoxItem.setStationCname(item.getStationCname());
-											tradingBoxItem.setStationEname(item.getStationEname());
-											tradingBoxItem.setPolCyId(item.getStationId());
-											tradingBoxItem.setPolCyCode(item.getStationCode());
-											tradingBoxItem.setPolCyCname(item.getStationCname());
-											tradingBoxItem.setPolCyEname(item.getStationEname());
-											if (ObjectUtils.isNotNull(item.getApproachExitDate())) {
-												tradingBoxItem.setRentEndDate(item.getApproachExitDate());
-												tradingBoxItem.setPolPickUpDate(item.getApproachExitDate());
-												tradingBoxItem.setPolPreAppearanceDate(item.getApproachExitDate());
-											} else {
-												tradingBoxItem.setRentEndDate(new Date());
-												tradingBoxItem.setPolPickUpDate(new Date());
-												tradingBoxItem.setPolPreAppearanceDate(new Date());
-											}
-											tradingBoxItem.setStatus("待使用");
+								} else {
+									tradingBoxes.add(tradingBox);
+								}
+								TradingBoxItem tradingBoxItem;
+								if (!tradingBoxItemList.isEmpty()) {
+									tradingBoxItem = tradingBoxItemList.stream().filter(e -> e.getCode().equals(item.getBoxCode()))
+										.findFirst().orElse(null);
+									if (tradingBoxItem != null) {
+										tradingBoxItem.setPid(tradingBox.getId());
+										tradingBoxItem.setBoxDynamics("调箱进场");
+										tradingBoxItem.setPortId(item.getPortId());
+										tradingBoxItem.setPortCode(item.getPortCode());
+										tradingBoxItem.setPortCname(item.getPortCname());
+										tradingBoxItem.setPortEname(item.getPortEname());
+										tradingBoxItem.setStationId(item.getStationId());
+										tradingBoxItem.setStationCode(item.getStationCode());
+										tradingBoxItem.setStationCname(item.getStationCname());
+										tradingBoxItem.setStationEname(item.getStationEname());
+										tradingBoxItem.setPolCyId(item.getStationId());
+										tradingBoxItem.setPolCyCode(item.getStationCode());
+										tradingBoxItem.setPolCyCname(item.getStationCname());
+										tradingBoxItem.setPolCyEname(item.getStationEname());
+										if (ObjectUtils.isNotNull(item.getApproachExitDate())) {
+											tradingBoxItem.setRentEndDate(item.getApproachExitDate());
+											tradingBoxItem.setPolPickUpDate(item.getApproachExitDate());
+											tradingBoxItem.setPolPreAppearanceDate(item.getApproachExitDate());
 										} else {
-											tradingBoxItem = new TradingBoxItem();
-											tradingBoxItem.setBoxBelongsTo("SOC");
-											if ("OW-N".equals(tradingBox.getType())) {
-												tradingBoxItem.setBoxCategory("OW(拿)");
-											} else if ("OW-F".equals(tradingBox.getType())) {
-												tradingBoxItem.setBoxCategory("OW(放)");
-											}
-											putBoxItem.setBoxClass(putBox.getBusType());
-											tradingBoxItem.setBoxCondition("新");
-											tradingBoxItem.setBoxStatus(item.getBoxStatus());
-											tradingBoxItem.setPid(tradingBox.getId());
-											tradingBoxItem.setContainerNumber(item.getContainerNumber());
-											tradingBoxItem.setCode(item.getBoxCode());
-											tradingBoxItem.setBoxDynamics("调箱进场");
-											tradingBoxItem.setBoxType(item.getBoxType());
-											tradingBoxItem.setPortId(item.getPortId());
-											tradingBoxItem.setPortCode(item.getPortCode());
-											tradingBoxItem.setPortCname(item.getPortCname());
-											tradingBoxItem.setPortEname(item.getPortEname());
-											tradingBoxItem.setStationId(item.getStationId());
-											tradingBoxItem.setStationCode(item.getStationCode());
-											tradingBoxItem.setStationCname(item.getStationCname());
-											tradingBoxItem.setStationEname(item.getStationEname());
-											tradingBoxItem.setPolCyId(item.getStationId());
-											tradingBoxItem.setPolCyCode(item.getStationCode());
-											tradingBoxItem.setPolCyCname(item.getStationCname());
-											tradingBoxItem.setPolCyEname(item.getStationEname());
-											tradingBoxItem.setActivationDate(tradingBox.getActivationDate());
-											if (ObjectUtils.isNotNull(item.getApproachExitDate())) {
-												tradingBoxItem.setRentEndDate(item.getApproachExitDate());
-												tradingBoxItem.setPolPickUpDate(item.getApproachExitDate());
-												tradingBoxItem.setPolPreAppearanceDate(item.getApproachExitDate());
-											} else {
-												tradingBoxItem.setRentEndDate(new Date());
-												tradingBoxItem.setPolPickUpDate(new Date());
-												tradingBoxItem.setPolPreAppearanceDate(new Date());
-											}
-											tradingBoxItem.setStatus("待使用");
+											tradingBoxItem.setRentEndDate(new Date());
+											tradingBoxItem.setPolPickUpDate(new Date());
+											tradingBoxItem.setPolPreAppearanceDate(new Date());
 										}
+										tradingBoxItem.setStatus("待使用");
 									} else {
 										tradingBoxItem = new TradingBoxItem();
+										tradingBoxItem.setBoxBelongsTo("SOC");
 										if ("OW-N".equals(tradingBox.getType())) {
 											tradingBoxItem.setBoxCategory("OW(拿)");
 										} else if ("OW-F".equals(tradingBox.getType())) {
 											tradingBoxItem.setBoxCategory("OW(放)");
 										}
-										tradingBoxItem.setBoxBelongsTo("SOC");
+										putBoxItem.setBoxClass(putBox.getBusType());
 										tradingBoxItem.setBoxCondition("新");
 										tradingBoxItem.setBoxStatus(item.getBoxStatus());
 										tradingBoxItem.setPid(tradingBox.getId());
@@ -1674,15 +1635,53 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 										}
 										tradingBoxItem.setStatus("待使用");
 									}
-									tradingBoxItem.setBoxEastId(tradingBox.getPurchaseCompanyId());
-									tradingBoxItem.setBoxEastName(tradingBox.getPurchaseCompanyName());
-									tradingBoxItems.add(tradingBoxItem);
 								} else {
-									throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
+									tradingBoxItem = new TradingBoxItem();
+									if ("OW-N".equals(tradingBox.getType())) {
+										tradingBoxItem.setBoxCategory("OW(拿)");
+									} else if ("OW-F".equals(tradingBox.getType())) {
+										tradingBoxItem.setBoxCategory("OW(放)");
+									}
+									tradingBoxItem.setBoxBelongsTo("SOC");
+									tradingBoxItem.setBoxCondition("新");
+									tradingBoxItem.setBoxStatus(item.getBoxStatus());
+									tradingBoxItem.setPid(tradingBox.getId());
+									tradingBoxItem.setContainerNumber(item.getContainerNumber());
+									tradingBoxItem.setCode(item.getBoxCode());
+									tradingBoxItem.setBoxDynamics("调箱进场");
+									tradingBoxItem.setBoxType(item.getBoxType());
+									tradingBoxItem.setPortId(item.getPortId());
+									tradingBoxItem.setPortCode(item.getPortCode());
+									tradingBoxItem.setPortCname(item.getPortCname());
+									tradingBoxItem.setPortEname(item.getPortEname());
+									tradingBoxItem.setStationId(item.getStationId());
+									tradingBoxItem.setStationCode(item.getStationCode());
+									tradingBoxItem.setStationCname(item.getStationCname());
+									tradingBoxItem.setStationEname(item.getStationEname());
+									tradingBoxItem.setPolCyId(item.getStationId());
+									tradingBoxItem.setPolCyCode(item.getStationCode());
+									tradingBoxItem.setPolCyCname(item.getStationCname());
+									tradingBoxItem.setPolCyEname(item.getStationEname());
+									tradingBoxItem.setActivationDate(tradingBox.getActivationDate());
+									if (ObjectUtils.isNotNull(item.getApproachExitDate())) {
+										tradingBoxItem.setRentEndDate(item.getApproachExitDate());
+										tradingBoxItem.setPolPickUpDate(item.getApproachExitDate());
+										tradingBoxItem.setPolPreAppearanceDate(item.getApproachExitDate());
+									} else {
+										tradingBoxItem.setRentEndDate(new Date());
+										tradingBoxItem.setPolPickUpDate(new Date());
+										tradingBoxItem.setPolPreAppearanceDate(new Date());
+									}
+									tradingBoxItem.setStatus("待使用");
 								}
+								tradingBoxItem.setBoxEastId(tradingBox.getPurchaseCompanyId());
+								tradingBoxItem.setBoxEastName(tradingBox.getPurchaseCompanyName());
+								tradingBoxItems.add(tradingBoxItem);
 							} else {
 								throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
 							}
+						} else {
+							throw new RuntimeException("放箱号:" + item.getContainerNumber() + "未查到OW单据");
 						}
 					} else {
 						throw new RuntimeException("未查到放箱号:" + item.getContainerNumber() + "单据");
@@ -1743,10 +1742,10 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 									tradingBox.setCode(itemsListZJ.stream().filter(e -> e.getContainerNumber().equals(item.getContainerNumber()))
 										.map(BoxDynamicsRecordItems::getBoxCode).collect(Collectors.joining(",")));
 								}
-								if ("OW(拿)".contains(item.getBusType())) {
-									tradingBox.setSuitcaseNum(tradingBox.getSuitcaseNum() + Integer.parseInt(count1 + ""));
-									tradingBox.setNotSuitcaseNum(tradingBox.getBoxNumber() - tradingBox.getSuitcaseNum());
-								}
+									tradingBox.setActualBoxNumber(tradingBox.getSuitcaseNum() + Integer.parseInt(count1 + ""));
+									if (Objects.equals(tradingBox.getActualBoxNumber(), tradingBox.getBoxNumber())){
+										tradingBox.setStatus(1);
+									}
 								tradingBoxMapper.updateById(tradingBox);
 							}
 						}
@@ -1867,6 +1866,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 					tradingBoxList = tradingBoxMapper.selectList(new LambdaQueryWrapper<TradingBox>()
 						.eq(TradingBox::getTenantId, AuthUtil.getTenantId())
 						.eq(TradingBox::getIsDeleted, 0)
+						.eq(TradingBox::getStatus, 0)
 						.in(TradingBox::getId, srcIdList));
 				}
 				List<TradingBoxItem> tradingBoxItemList = new ArrayList<>();
@@ -3146,7 +3146,7 @@ public class BoxDynamicsRecordServiceImpl extends ServiceImpl<BoxDynamicsRecordM
 				.eq(PutBoxItems::getIsDeleted, 0)
 				.eq(PutBoxItems::getTenantId, tenantId)
 				.in(PutBoxItems::getPid, putBoxIdList));
-			String blacklist = sysClient.getParamServiceDWT("box.blacklist",tenantId);
+			String blacklist = sysClient.getParamServiceDWT("box.blacklist", tenantId);
 			if (ObjectUtils.isNotNull(blacklist)) {
 				StringBuilder text = new StringBuilder();
 				for (String item : boxCodeList) {

+ 3 - 1
blade-service/blade-los/src/main/java/org/springblade/los/box/service/ITradingBoxItemService.java

@@ -24,6 +24,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.multipart.MultipartFile;
 
+import java.text.ParseException;
+
 /**
  * 买(卖)箱明细表 服务类
  *
@@ -41,5 +43,5 @@ public interface ITradingBoxItemService extends IService<TradingBoxItem> {
 	 */
 	IPage<TradingBoxItemVO> selectTradingBoxItemPage(IPage<TradingBoxItemVO> page, TradingBoxItemVO tradingBoxItem);
 
-    R importBoxItem(MultipartFile file,Long id,String type);
+    R importBoxItem(MultipartFile file,Long id,String type) throws ParseException;
 }

+ 96 - 10
blade-service/blade-los/src/main/java/org/springblade/los/box/service/impl/TradingBoxItemServiceImpl.java

@@ -36,10 +36,7 @@ import org.springblade.los.basic.ports.entity.BPorts;
 import org.springblade.los.basic.ports.service.IBPortsService;
 import org.springblade.los.box.entity.TradingBox;
 import org.springblade.los.box.entity.TradingBoxItem;
-import org.springblade.los.box.excel.AgentBoxItemExcel;
-import org.springblade.los.box.excel.BoxFeeItemExcel;
-import org.springblade.los.box.excel.RentalBoxItemExcel;
-import org.springblade.los.box.excel.TradingBoxItemExcel;
+import org.springblade.los.box.excel.*;
 import org.springblade.los.box.mapper.TradingBoxItemMapper;
 import org.springblade.los.box.mapper.TradingBoxMapper;
 import org.springblade.los.box.service.ITradingBoxItemService;
@@ -50,6 +47,8 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
 
 import java.math.BigDecimal;
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -85,7 +84,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public R importBoxItem(MultipartFile file, Long id, String type) {
+	public R importBoxItem(MultipartFile file, Long id, String type) throws ParseException {
 		if (id == null) {
 			throw new RuntimeException("缺少必要参数");
 		}
@@ -280,6 +279,40 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 				.distinct().collect(Collectors.joining(","));
 			station = excelList.stream().map(BoxFeeItemExcel::getStationCname).filter(Objects::nonNull)
 				.distinct().collect(Collectors.joining(","));
+		} else if ("5".contains(type)) {
+			//导入数据
+			List<TransferBoxExcel> excelList = ExcelUtil.read(file, TransferBoxExcel.class);
+			if (CollectionUtils.isEmpty(excelList)) {
+				throw new SecurityException("数据不能为空");
+			}
+			//箱号拼接字符串
+			codes = excelList.stream().map(TransferBoxExcel::getCode).distinct().collect(Collectors.toList());
+			if (excelList.size() != codes.size()) {
+				throw new RuntimeException("本单据明细存在重复箱号,操作失败!");
+			}
+			for (TransferBoxExcel item : excelList) {
+				if (ObjectUtils.isNull(item.getCode())) {
+					throw new RuntimeException("箱号不能为空");
+				}
+				BoxNumUtils.containerNumberVerification(item.getCode());
+				if (ObjectUtils.isNull(item.getBoxType())) {
+					throw new RuntimeException("箱型不能为空");
+				}
+				item.setBoxType(item.getBoxType().toUpperCase());
+				if (ObjectUtils.isNull(item.getBoxStatus())) {
+					throw new RuntimeException("箱好坏不能为空");
+				}
+				if (ObjectUtils.isNull(item.getBoxCondition())) {
+					throw new RuntimeException("箱况不能为空");
+				}
+				if (ObjectUtils.isNull(item.getStationCname())) {
+					throw new RuntimeException("场站不能为空");
+				}
+			}
+			boxType = excelList.stream().map(TransferBoxExcel::getBoxType).filter(Objects::nonNull)
+				.distinct().collect(Collectors.toList());
+			station = excelList.stream().map(TransferBoxExcel::getStationCname).filter(Objects::nonNull)
+				.distinct().collect(Collectors.joining(","));
 		}
 		List<TradingBoxItem> itemList = baseMapper.selectList(new LambdaQueryWrapper<TradingBoxItem>()
 			.eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId())
@@ -305,7 +338,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 			throw new RuntimeException("请先维护默认箱东");
 		}
 		if (ObjectUtils.isNotNull(stationName)) {
-			stationName = stationName + ","+defaultBoxEast;
+			stationName = stationName + "," + defaultBoxEast;
 			if (ObjectUtils.isNotNull(cyCname)) {
 				stationName = stationName + "," + cyCname;
 			}
@@ -391,7 +424,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 					}
 					BCorps bCorps = corpsList.stream().filter(e -> defaultBoxEast.equals(e.getCnName())).findFirst().orElse(null);
 					if (bCorps == null) {
-						throw new RuntimeException("箱东:"+defaultBoxEast+"不存在,请先维护基础资料");
+						throw new RuntimeException("箱东:" + defaultBoxEast + "不存在,请先维护基础资料");
 					}
 					if ("BUY".equals(tradingBox.getType())) {
 						tradingBoxItem.setBoxEastId(bCorps.getId());
@@ -507,7 +540,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 					}
 					BCorps bCorps = corpsList.stream().filter(e -> defaultBoxEast.equals(e.getCnName())).findFirst().orElse(null);
 					if (bCorps == null) {
-						throw new RuntimeException("箱东:"+defaultBoxEast+"不存在,请先维护基础资料");
+						throw new RuntimeException("箱东:" + defaultBoxEast + "不存在,请先维护基础资料");
 					}
 					if ("BUY".equals(tradingBox.getType())) {
 						tradingBoxItem.setBoxEastId(bCorps.getId());
@@ -620,7 +653,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 					}
 					BCorps bCorps = corpsList.stream().filter(e -> defaultBoxEast.equals(e.getCnName())).findFirst().orElse(null);
 					if (bCorps == null) {
-						throw new RuntimeException("箱东:"+defaultBoxEast+"不存在,请先维护基础资料");
+						throw new RuntimeException("箱东:" + defaultBoxEast + "不存在,请先维护基础资料");
 					}
 					if ("BUY".equals(tradingBox.getType())) {
 						tradingBoxItem.setBoxEastId(bCorps.getId());
@@ -723,7 +756,7 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 					}
 					BCorps bCorps = corpsList.stream().filter(e -> defaultBoxEast.equals(e.getCnName())).findFirst().orElse(null);
 					if (bCorps == null) {
-						throw new RuntimeException("箱东:"+defaultBoxEast+"不存在,请先维护基础资料");
+						throw new RuntimeException("箱东:" + defaultBoxEast + "不存在,请先维护基础资料");
 					}
 					if ("BUY".equals(tradingBox.getType())) {
 						tradingBoxItem.setBoxEastId(bCorps.getId());
@@ -772,6 +805,59 @@ public class TradingBoxItemServiceImpl extends ServiceImpl<TradingBoxItemMapper,
 				tradingBoxItem.setBoxMakingDate(item.getBoxMakingDate());
 				tradingBoxItemList.add(tradingBoxItem);
 			}
+		} else if ("5".contains(type)) {
+			List<TransferBoxExcel> excelList = ExcelUtil.read(file, TransferBoxExcel.class);
+			SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+			for (TransferBoxExcel item : excelList) {
+				TradingBoxItem tradingBoxItem;
+				if (!itemList.isEmpty()) {
+					tradingBoxItem = itemList.stream().filter(e -> e.getCode().equals(item.getCode())).findFirst().orElse(null);
+					if (tradingBoxItem == null) {
+						tradingBoxItem = new TradingBoxItem();
+					}
+				} else {
+					tradingBoxItem = new TradingBoxItem();
+				}
+				if (ObjectUtils.isNotNull(item.getCode())) {
+					tradingBoxItem.setCode(item.getCode().trim());
+					tradingBoxItem.setCode(item.getCode().toUpperCase());
+				}
+				tradingBoxItem.setBoxCondition(item.getBoxCondition());
+				tradingBoxItem.setBoxStatus(item.getBoxStatus());
+				BCntrTypes bCntrTypes = cntrTypesList.stream().filter(e -> e.getCnName().equals(item.getBoxType())).findFirst().orElse(null);
+				if (bCntrTypes == null) {
+					throw new RuntimeException("箱型:" + item.getBoxType() + "不存在,请先维护基础资料");
+				}
+				if (!corpsList.isEmpty()) {
+					if (ObjectUtils.isNotNull(item.getStationCname())) {
+						BCorps stationCname = corpsList.stream().filter(e -> item.getStationCname().equals(e.getCnName())).findFirst().orElse(null);
+						if (stationCname == null) {
+							throw new RuntimeException("场站:" + item.getStationCname() + "不存在,请先维护基础资料");
+						}
+						tradingBoxItem.setStationId(stationCname.getId());
+						tradingBoxItem.setStationCname(stationCname.getCnName());
+						tradingBoxItem.setStationCode(stationCname.getCode());
+						tradingBoxItem.setStationEname(stationCname.getEnName());
+					}
+				}
+				if (ObjectUtils.isNotNull(item.getPolPickUpDate())){
+					tradingBoxItem.setPolPickUpDate(formatter.parse(item.getPolPickUpDate()));
+				}
+				if (ObjectUtils.isNotNull(item.getPolStationEmptyContainerExitDate())){
+					tradingBoxItem.setPolStationEmptyContainerExitDate(formatter.parse(item.getPolStationEmptyContainerExitDate()));
+				}
+				tradingBoxItem.setBoxType(bCntrTypes.getCnName());
+				tradingBoxItem.setBoxTypeId(bCntrTypes.getId());
+				tradingBoxItem.setBoxCategory(item.getBoxCategory());
+				tradingBoxItem.setBoxBelongsTo("SOC");
+				tradingBoxItem.setStatus("待使用");
+				tradingBoxItem.setCreateUser(AuthUtil.getUserId());
+				tradingBoxItem.setCreateUserName(AuthUtil.getUserName());
+				tradingBoxItem.setCreateTime(new Date());
+				tradingBoxItem.setPid(tradingBox.getId());
+				tradingBoxItem.setRemarks(item.getRemarks());
+				tradingBoxItemList.add(tradingBoxItem);
+			}
 		}
 		if (!tradingBoxItemList.isEmpty()) {
 			this.saveOrUpdateBatch(tradingBoxItemList);

+ 0 - 3
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/BillsServiceImpl.java

@@ -3130,9 +3130,6 @@ public class BillsServiceImpl extends ServiceImpl<BillsMapper, Bills> implements
 		if (!containersList.isEmpty()) {
 			List<Containers> containersListNew = new ArrayList<>();
 			for (Containers item : containersList) {
-				if (ObjectUtils.isNull(item.getPodStationId()) || item.getPodStationId() == 0) {
-					throw new RuntimeException("请先维护配箱POD堆场信息");
-				}
 				item.setSrcId(item.getId());
 				item.setId(null);
 				item.setCreateTime(new Date());

+ 5 - 0
blade-service/blade-los/src/main/java/org/springblade/los/lock/controller/LockController.java

@@ -77,6 +77,9 @@ public class LockController extends BladeController {
 	@ApiOperation(value = "分页", notes = "传入lock")
 	public R<IPage<LosLock>> list(LosLock lock, Query query) {
 		lock.setTenantId(SecureUtil.getTenantId());
+		if (!AuthUtil.getUserRole().contains("总部") && !AuthUtil.getUserRole().contains("admin")) {
+			lock.setCreateDept(Long.parseLong(AuthUtil.getDeptId()));
+		}
 		IPage<LosLock> pages = lockService.page(Condition.getPage(query), Condition.getQueryWrapper(lock));
 		return R.data(pages);
 	}
@@ -198,6 +201,7 @@ public class LockController extends BladeController {
 		lockLambdaQueryWrapper
 			.eq(LosLock::getBillId, billId)
 			.eq(LosLock::getMoudleName, moduleName)
+			.eq(LosLock::getCreateDept, AuthUtil.getDeptId())
 			.eq(LosLock::getTableName, tableName)
 			.eq(LosLock::getTenantId, AuthUtil.getTenantId());
 		int count = lockService.count(lockLambdaQueryWrapper);
@@ -234,6 +238,7 @@ public class LockController extends BladeController {
 			lock.setLockNo(no + AuthUtil.getUserName());
 			lock.setCreateTime(new Date());
 			lock.setCreateUser(AuthUtil.getUserId());
+			lock.setCreateDept(Long.parseLong(AuthUtil.getDeptId()));
 			lockService.save(lock);
 			return R.success("OK");
 		}