Merge branch 'dev_qinhongzhanWMS' into wms_dev
This commit is contained in:
+3
@@ -139,6 +139,9 @@ public class NoticeOrderApplicationService {
|
||||
* @param noticeOrderDO
|
||||
*/
|
||||
private void setWarehouseInfo(NoticeOrderDO noticeOrderDO) {
|
||||
if (noticeOrderDO.getWarehouseId() == null) {
|
||||
throw new ServiceException("仓库ID不能为空");
|
||||
}
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(noticeOrderDO.getWarehouseId());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
|
||||
+3
@@ -339,6 +339,9 @@ public class ShiftManageApplicationService {
|
||||
* @param shiftManageDO
|
||||
*/
|
||||
private void setWarehouseInfo(ShiftManageDO shiftManageDO) {
|
||||
if (shiftManageDO.getWarehouseId() == null) {
|
||||
throw new ServiceException("仓库ID不能为空");
|
||||
}
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(shiftManageDO.getWarehouseId());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
|
||||
+353
-21
@@ -17,14 +17,26 @@ import com.mhd.system.api.domain.WarehouseFeignPO;
|
||||
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
|
||||
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
import com.mhd.wms.domain.stockInOrder.repository.po.StockInOrderPO;
|
||||
import com.mhd.wms.domain.stockInOrder.repository.todo.StockInOrderDO;
|
||||
import com.mhd.wms.domain.inMaterialDetail.repository.todo.InMaterialDetailDO;
|
||||
import com.mhd.wms.domain.stockInOrder.service.StockInOrderDomainService;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.facade.IMaterialBaseInfoService;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO;
|
||||
import com.mhd.wms.interfaces.dto.stockInOrder.StockInOrderImportRowDTO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 入库单ApplicationService
|
||||
@@ -41,6 +53,8 @@ public class StockInOrderApplicationService {
|
||||
private UserServiceFeign userServiceFeign;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private IMaterialBaseInfoService materialBaseInfoService;
|
||||
|
||||
|
||||
/**
|
||||
@@ -65,14 +79,26 @@ public class StockInOrderApplicationService {
|
||||
* 新增入库单
|
||||
*/
|
||||
public Boolean insert(StockInOrderDO stockInOrderDO) {
|
||||
//设置仓库
|
||||
setWarehouseInfo(stockInOrderDO);
|
||||
// 如果仓库ID为空,从当前登录用户的关联仓库中获取
|
||||
// if (stockInOrderDO.getWarehouseId() == null) {
|
||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// if (loginUser == null) {
|
||||
// throw new ServiceException("登录已失效,请重新登录");
|
||||
// }
|
||||
// AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
// if (associationWarehouseCacheDO == null || associationWarehouseCacheDO.getWarehouseId() == null) {
|
||||
// throw new ServiceException("当前用户未配置关联仓库,请先配置仓库");
|
||||
// }
|
||||
// stockInOrderDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
// }
|
||||
// //设置仓库
|
||||
// setWarehouseInfo(stockInOrderDO);
|
||||
//设置货主信息
|
||||
shipperParam(stockInOrderDO);
|
||||
// shipperParam(stockInOrderDO);
|
||||
//设置供应商信息
|
||||
supplierParam(stockInOrderDO);
|
||||
// supplierParam(stockInOrderDO);
|
||||
//设置数据字典键值
|
||||
setDataDict(stockInOrderDO);
|
||||
// setDataDict(stockInOrderDO);
|
||||
return stockInOrderDomainService.insert(stockInOrderDO);
|
||||
}
|
||||
|
||||
@@ -81,13 +107,13 @@ public class StockInOrderApplicationService {
|
||||
*/
|
||||
public Boolean update(StockInOrderDO stockInOrderDO) {
|
||||
//设置仓库
|
||||
setWarehouseInfo(stockInOrderDO);
|
||||
// setWarehouseInfo(stockInOrderDO);
|
||||
//设置货主信息
|
||||
shipperParam(stockInOrderDO);
|
||||
// shipperParam(stockInOrderDO);
|
||||
//设置供应商信息
|
||||
supplierParam(stockInOrderDO);
|
||||
// supplierParam(stockInOrderDO);
|
||||
//设置数据字典键值
|
||||
setDataDict(stockInOrderDO);
|
||||
// setDataDict(stockInOrderDO);
|
||||
return stockInOrderDomainService.update(stockInOrderDO);
|
||||
}
|
||||
|
||||
@@ -107,6 +133,7 @@ public class StockInOrderApplicationService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description 审核入库单
|
||||
* @author ZhouGY
|
||||
@@ -141,6 +168,301 @@ public class StockInOrderApplicationService {
|
||||
return stockInOrderDomainService.closeOrder(stockInOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入入库单(根据Excel模板:表头在第1-12行,明细表从第13行开始)
|
||||
* Excel模板结构:
|
||||
* - 第1-12行:表头信息(包含委托编号NO、客户名称等)
|
||||
* - 第13行:明细表列名
|
||||
* - 第14行开始:明细数据
|
||||
*/
|
||||
public Boolean importData(MultipartFile file) {
|
||||
if (file == null || file.isEmpty()) {
|
||||
throw new ServiceException("导入文件不能为空");
|
||||
}
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser == null) {
|
||||
throw new ServiceException("登录已失效,请重新登录");
|
||||
}
|
||||
|
||||
try (InputStream is = file.getInputStream()) {
|
||||
// 明细表的列名在第13行(索引12),数据从第14行开始
|
||||
int detailTitleRowIndex = 12; // 第13行(索引从0开始)
|
||||
|
||||
// 先读取表头信息(第1-12行),提取委托编号NO、客户名称等信息
|
||||
String headerConsignmentNo = null;
|
||||
String headerCustomerName = null;
|
||||
try (InputStream isForHeader = file.getInputStream()) {
|
||||
Workbook wb = WorkbookFactory.create(isForHeader);
|
||||
Sheet sheet = wb.getSheetAt(0);
|
||||
|
||||
// 从表头部分(第1-12行)读取关键信息
|
||||
for (int rowIdx = 0; rowIdx < 12; rowIdx++) {
|
||||
Row row = sheet.getRow(rowIdx);
|
||||
if (row != null) {
|
||||
for (int colIdx = 0; colIdx < row.getPhysicalNumberOfCells(); colIdx++) {
|
||||
Cell cell = row.getCell(colIdx);
|
||||
if (cell != null) {
|
||||
String cellValue = getCellValueAsString(cell);
|
||||
if (StringUtils.isNotBlank(cellValue)) {
|
||||
// 查找"委托编号"相关字段
|
||||
if (cellValue.contains("委托编号")) {
|
||||
// 尝试下一个单元格
|
||||
Cell valueCell = row.getCell(colIdx + 1);
|
||||
if (valueCell != null) {
|
||||
String consignmentNo = getCellValueAsString(valueCell);
|
||||
if (StringUtils.isNotBlank(consignmentNo) && !consignmentNo.contains("委托编号") && !consignmentNo.contains("NO")) {
|
||||
headerConsignmentNo = consignmentNo;
|
||||
log.info("从表头第{}行读取到委托编号NO: {}", rowIdx + 1, consignmentNo);
|
||||
}
|
||||
}
|
||||
// 也尝试当前单元格是否包含值(格式可能是"委托编号NO: 001")
|
||||
if (headerConsignmentNo == null && cellValue.contains(":")) {
|
||||
String[] parts = cellValue.split(":");
|
||||
if (parts.length > 1) {
|
||||
String consignmentNo = parts[1].trim();
|
||||
if (StringUtils.isNotBlank(consignmentNo) && !consignmentNo.contains("委托编号") && !consignmentNo.contains("NO")) {
|
||||
headerConsignmentNo = consignmentNo;
|
||||
log.info("从表头第{}行读取到委托编号NO(从同一单元格): {}", rowIdx + 1, consignmentNo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// 查找"客户名称"相关字段
|
||||
if (cellValue.contains("客户名称")) {
|
||||
// 尝试下一个单元格
|
||||
Cell valueCell = row.getCell(colIdx + 1);
|
||||
if (valueCell != null) {
|
||||
String customerName = getCellValueAsString(valueCell);
|
||||
if (StringUtils.isNotBlank(customerName) && !customerName.contains("客户")) {
|
||||
headerCustomerName = customerName;
|
||||
log.info("从表头第{}行读取到客户名称: {}", rowIdx + 1, customerName);
|
||||
}
|
||||
}
|
||||
// 也尝试当前单元格是否包含值(格式可能是"客户名称: 客户")
|
||||
if (headerCustomerName == null && cellValue.contains(":")) {
|
||||
String[] parts = cellValue.split(":");
|
||||
if (parts.length > 1) {
|
||||
String customerName = parts[1].trim();
|
||||
if (StringUtils.isNotBlank(customerName) && !customerName.contains("客户")) {
|
||||
headerCustomerName = customerName;
|
||||
log.info("从表头第{}行读取到客户名称(从同一单元格): {}", rowIdx + 1, customerName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
log.info("表头信息读取完成 - 委托编号NO: {}, 客户名称: {}", headerConsignmentNo, headerCustomerName);
|
||||
} catch (Exception e) {
|
||||
log.error("读取Excel表头信息失败", e);
|
||||
// 不抛出异常,继续尝试从明细行读取
|
||||
}
|
||||
|
||||
ExcelUtil<StockInOrderImportRowDTO> util = new ExcelUtil<>(StockInOrderImportRowDTO.class);
|
||||
// 从第13行(索引12)读取明细数据
|
||||
List<StockInOrderImportRowDTO> rows = null;
|
||||
try {
|
||||
rows = util.importExcel(is, detailTitleRowIndex);
|
||||
} catch (Exception e) {
|
||||
log.error("读取Excel明细数据失败", e);
|
||||
throw new ServiceException("读取Excel明细数据失败:" + e.getMessage() + "。请检查Excel第13行是否为明细表列名,第14行开始是否为数据行");
|
||||
}
|
||||
if (rows == null || rows.isEmpty()) {
|
||||
throw new ServiceException("导入数据为空。请检查Excel第13行是否为明细表列名(包含'商品名称'列),第14行开始是否为数据行");
|
||||
}
|
||||
log.info("成功读取 {} 行明细数据", rows.size());
|
||||
|
||||
// 将表头信息应用到每一行明细数据
|
||||
for (StockInOrderImportRowDTO row : rows) {
|
||||
if (row != null) {
|
||||
// 应用表头中的委托编号NO
|
||||
if (StringUtils.isBlank(row.getConsignmentNo()) && StringUtils.isNotBlank(headerConsignmentNo)) {
|
||||
row.setConsignmentNo(headerConsignmentNo);
|
||||
}
|
||||
// 应用表头中的客户名称(表头有客户名称时,强制应用到所有明细行)
|
||||
if (StringUtils.isNotBlank(headerCustomerName)) {
|
||||
row.setCustomerName(headerCustomerName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 过滤掉关键字段都为空的空行(只需要商品名称不为空即可)
|
||||
List<StockInOrderImportRowDTO> validRows = rows.stream()
|
||||
.filter(r -> r != null && StringUtils.isNotBlank(r.getMaterialName()))
|
||||
.collect(Collectors.toList());
|
||||
if (validRows.isEmpty()) {
|
||||
String errorMsg = String.format("导入数据为空(可能全为空行)。共读取 %d 行数据,但商品名称都为空。\n" +
|
||||
"请检查Excel第13行是否为明细表列名(包含'商品名称'列),第14行开始是否为数据行。", rows.size());
|
||||
throw new ServiceException(errorMsg);
|
||||
}
|
||||
|
||||
// 以委托编号NO分组;若为空则归到同一组
|
||||
Map<String, List<StockInOrderImportRowDTO>> groupMap = validRows.stream()
|
||||
.collect(Collectors.groupingBy(r -> StringUtils.isBlank(r.getConsignmentNo()) ? "__EMPTY_CONSIGNMENT__" : r.getConsignmentNo()));
|
||||
|
||||
List<StockInOrderDO> orderList = new ArrayList<>();
|
||||
for (Map.Entry<String, List<StockInOrderImportRowDTO>> entry : groupMap.entrySet()) {
|
||||
List<StockInOrderImportRowDTO> groupRows = entry.getValue();
|
||||
StockInOrderImportRowDTO h = groupRows.get(0);
|
||||
|
||||
// 获取仓库ID(使用登录人当前关联仓库)
|
||||
Long warehouseId;
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
if (associationWarehouseCacheDO == null || associationWarehouseCacheDO.getWarehouseId() == null) {
|
||||
throw new ServiceException("导入失败:未配置用户关联仓库,请先配置仓库");
|
||||
}
|
||||
warehouseId = associationWarehouseCacheDO.getWarehouseId();
|
||||
|
||||
// 客户名称应该从表头获取
|
||||
String customerName = StringUtils.isNotBlank(headerCustomerName) ? headerCustomerName : h.getCustomerName();
|
||||
if (StringUtils.isBlank(customerName)) {
|
||||
throw new ServiceException("导入失败:客户名称不能为空(委托编号NO=" + h.getConsignmentNo() + ")。请确保Excel表头(第1-12行)中包含'客户名称'字段");
|
||||
}
|
||||
// 如果明细行的客户名称为空,使用表头的客户名称
|
||||
if (StringUtils.isBlank(h.getCustomerName()) && StringUtils.isNotBlank(headerCustomerName)) {
|
||||
h.setCustomerName(headerCustomerName);
|
||||
}
|
||||
|
||||
StockInOrderDO order = new StockInOrderDO();
|
||||
// 组织/审计字段
|
||||
order.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
order.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
order.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
order.setCreateBy(loginUser.getUserid());
|
||||
order.setCreateByName(loginUser.getUsername());
|
||||
|
||||
// 必填/基础字段
|
||||
order.setWarehouseId(warehouseId);
|
||||
// 货主ID不需要,直接设置为null,使用客户名称作为货主名称
|
||||
order.setShipperId(null);
|
||||
if (StringUtils.isNotBlank(h.getCustomerName())) {
|
||||
order.setShipperName(h.getCustomerName());
|
||||
}
|
||||
// order.setSupplierId(h.getSupplierId());
|
||||
// order.setOrderTypeCode(h.getOrderTypeCode());
|
||||
order.setConsignmentNo(h.getConsignmentNo());
|
||||
order.setRemark(h.getRemark());
|
||||
|
||||
// 报关表头字段
|
||||
order.setTo(h.getTo());
|
||||
order.setContactPerson(h.getContactPerson());
|
||||
order.setVehicleInfo(h.getVehicleInfo());
|
||||
order.setTel(h.getTel());
|
||||
order.setDriverSignature(h.getDriverSignature());
|
||||
order.setFax(h.getFax());
|
||||
order.setDeclarationArea(h.getDeclarationArea());
|
||||
order.setManufacturer(h.getManufacturer());
|
||||
order.setCustomsBrokerInfo(h.getCustomsBrokerInfo());
|
||||
order.setDeliveryAddress(h.getDeliveryAddress());
|
||||
order.setEntryExitCustoms(h.getEntryExitCustoms());
|
||||
order.setOriginDestinationCountry(h.getOriginDestinationCountry());
|
||||
order.setCarrier(h.getCarrier());
|
||||
order.setContainerNo(h.getContainerNo());
|
||||
order.setTransportMethod(h.getTransportMethod());
|
||||
order.setSupervisionMethod(h.getSupervisionMethod());
|
||||
|
||||
// 报关字段默认值
|
||||
if (h.getCustomsInspection() == null) {
|
||||
order.setCustomsInspection(0); // 默认:否
|
||||
} else {
|
||||
order.setCustomsInspection(h.getCustomsInspection());
|
||||
}
|
||||
if (h.getNeedCustomsDeclaration() == null) {
|
||||
order.setNeedCustomsDeclaration(1); // 默认:是
|
||||
} else {
|
||||
order.setNeedCustomsDeclaration(h.getNeedCustomsDeclaration());
|
||||
}
|
||||
if (h.getNeedTransport() == null) {
|
||||
order.setNeedTransport(0); // 默认:否
|
||||
} else {
|
||||
order.setNeedTransport(h.getNeedTransport());
|
||||
}
|
||||
|
||||
// 明细
|
||||
List<InMaterialDetailDO> details = new ArrayList<>();
|
||||
for (StockInOrderImportRowDTO r : groupRows) {
|
||||
// 根据明细表中的字段查询物料基础信息(优先:料号 > 商品SKU码 > 商品名称)
|
||||
Long materialBaseInfoId = null;
|
||||
|
||||
// 使用仓库数量
|
||||
BigDecimal quantity = r.getWarehouseQuantity();
|
||||
if (quantity == null) {
|
||||
throw new ServiceException("导入失败:仓库数量不能为空(委托编号NO=" + h.getConsignmentNo() + ",物料基础信息ID=" + materialBaseInfoId + ")");
|
||||
}
|
||||
|
||||
InMaterialDetailDO d = new InMaterialDetailDO();
|
||||
d.setMaterialBaseInfoId(materialBaseInfoId);
|
||||
d.setQuantity(quantity);
|
||||
d.setSpecification(r.getSpecification());
|
||||
d.setSkuCode(r.getSkuCode());
|
||||
d.setInvoiceNo(r.getInvoiceNo());
|
||||
d.setDeclaredQuantity(r.getDeclaredQuantity());
|
||||
d.setDeclaredUnit(r.getDeclaredUnit());
|
||||
d.setLiter(r.getLiter());
|
||||
d.setBoxCount(r.getBoxCount());
|
||||
d.setPieceCount(r.getPieceCount());
|
||||
d.setDimensions(r.getDimensions());
|
||||
d.setOutboundQuantity(r.getOutboundQuantity());
|
||||
d.setUnit(r.getUnit());
|
||||
d.setTotalNetWeight(r.getTotalNetWeight());
|
||||
d.setTotalGrossWeight(r.getTotalGrossWeight());
|
||||
d.setTotalVolume(r.getTotalVolume());
|
||||
d.setTotalArea(r.getTotalArea());
|
||||
d.setBatchRefNo(r.getBatchRefNo());
|
||||
d.setSheetRefNo(r.getSheetRefNo());
|
||||
d.setCountryOfOrigin(r.getCountryOfOrigin());
|
||||
d.setBoxPalletNo(r.getBoxPalletNo());
|
||||
d.setTotalPrice(r.getTotalPrice());
|
||||
d.setCurrency(r.getCurrency());
|
||||
d.setRemark(r.getDetailRemark());
|
||||
details.add(d);
|
||||
}
|
||||
order.setMaterialDetailList(details);
|
||||
orderList.add(order);
|
||||
}
|
||||
|
||||
return stockInOrderDomainService.batchInsert(orderList);
|
||||
} catch (ServiceException e) {
|
||||
throw e;
|
||||
} catch (Exception e) {
|
||||
log.error("导入入库单失败", e);
|
||||
throw new ServiceException("导入入库单失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取Excel单元格的字符串值
|
||||
*/
|
||||
private String getCellValueAsString(Cell cell) {
|
||||
if (cell == null) {
|
||||
return "";
|
||||
}
|
||||
switch (cell.getCellType()) {
|
||||
case STRING:
|
||||
return cell.getStringCellValue();
|
||||
case NUMERIC:
|
||||
if (DateUtil.isCellDateFormatted(cell)) {
|
||||
return cell.getDateCellValue().toString();
|
||||
} else {
|
||||
double numericValue = cell.getNumericCellValue();
|
||||
if (numericValue == (long) numericValue) {
|
||||
return String.valueOf((long) numericValue);
|
||||
} else {
|
||||
return String.valueOf(numericValue);
|
||||
}
|
||||
}
|
||||
case BOOLEAN:
|
||||
return String.valueOf(cell.getBooleanCellValue());
|
||||
case FORMULA:
|
||||
return cell.getCellFormula();
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置仓库信息
|
||||
* @author ZhouGY
|
||||
@@ -158,17 +480,24 @@ public class StockInOrderApplicationService {
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 封装货主信息
|
||||
* @description 封装货主信息(货主信息就是客户)
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/9 20:43
|
||||
* @param stockInOrderDO
|
||||
*/
|
||||
private void shipperParam(StockInOrderDO stockInOrderDO){
|
||||
if (stockInOrderDO.getShipperId() == null) {
|
||||
throw new ServiceException("货主ID不能为空(货主信息就是客户)");
|
||||
}
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(stockInOrderDO.getShipperId());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取货主信息失败");
|
||||
String errorMsg = ajaxResult.get("msg") != null ? String.valueOf(ajaxResult.get("msg")) : "未知错误";
|
||||
throw new ServiceException("获取货主信息失败(货主ID: " + stockInOrderDO.getShipperId() + "),错误信息: " + errorMsg);
|
||||
}
|
||||
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
if (userPo == null) {
|
||||
throw new ServiceException("获取货主信息失败:返回数据为空(货主ID: " + stockInOrderDO.getShipperId() + ")");
|
||||
}
|
||||
stockInOrderDO.setShipperCode(userPo.getUserMemberCode());
|
||||
stockInOrderDO.setShipperName(userPo.getUserName());
|
||||
}
|
||||
@@ -198,17 +527,19 @@ public class StockInOrderApplicationService {
|
||||
*/
|
||||
private void setDataDict(StockInOrderDO stockInOrderDO){
|
||||
//翻译单据类型
|
||||
AjaxResult documentTypeResult = systemServiceFeign.selectListByDictType(DictCode.DOCUMENT_TYPE.getCode());
|
||||
if (!"200".equals(String.valueOf(documentTypeResult.get("code")))) {
|
||||
throw new ServiceException("单据类型数据字典不存在");
|
||||
}
|
||||
List<SysDictData> documentTypeDataList = JSON.parseArray(JSONUtil.toJsonStr(documentTypeResult.get("data")), SysDictData.class);
|
||||
if (StringUtils.isNotBlank(stockInOrderDO.getOrderTypeCode())){
|
||||
AjaxResult documentTypeResult = systemServiceFeign.selectListByDictType(DictCode.DOCUMENT_TYPE.getCode());
|
||||
if (!"200".equals(String.valueOf(documentTypeResult.get("code")))) {
|
||||
throw new ServiceException("单据类型数据字典不存在");
|
||||
}
|
||||
List<SysDictData> documentTypeDataList = JSON.parseArray(JSONUtil.toJsonStr(documentTypeResult.get("data")), SysDictData.class);
|
||||
|
||||
SysDictData documentTypeData = documentTypeDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), stockInOrderDO.getOrderTypeCode())).findAny().orElse(null);
|
||||
if (null == documentTypeData) {
|
||||
throw new ServiceException("单据类型【" + stockInOrderDO.getOrderTypeCode() + "】数据字典不存在 请联系管理员");
|
||||
SysDictData documentTypeData = documentTypeDataList.stream().filter(info -> ObjectUtil.equal(info.getDictValue(), stockInOrderDO.getOrderTypeCode())).findAny().orElse(null);
|
||||
if (null == documentTypeData) {
|
||||
throw new ServiceException("单据类型【" + stockInOrderDO.getOrderTypeCode() + "】数据字典不存在 请联系管理员");
|
||||
}
|
||||
stockInOrderDO.setOrderTypeName(documentTypeData.getDictLabel());
|
||||
}
|
||||
stockInOrderDO.setOrderTypeName(documentTypeData.getDictLabel());
|
||||
|
||||
//翻译优先级别类型
|
||||
if (StringUtils.isNotBlank(stockInOrderDO.getPriorityLevelCode())){
|
||||
@@ -225,4 +556,5 @@ public class StockInOrderApplicationService {
|
||||
stockInOrderDO.setPriorityLevelName(priorityLevelData.getDictLabel());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -384,6 +384,9 @@ public class StockOutOrderApplicationService {
|
||||
* @param stockOutOrderDO
|
||||
*/
|
||||
private void setWarehouseInfo(StockOutOrderDO stockOutOrderDO) {
|
||||
if (stockOutOrderDO.getWarehouseId() == null) {
|
||||
throw new ServiceException("仓库ID不能为空");
|
||||
}
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(stockOutOrderDO.getWarehouseId());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
|
||||
+3
@@ -645,6 +645,9 @@ public class StockReceiptOrderApplicationService {
|
||||
* @param stockReceiptOrderDO
|
||||
*/
|
||||
private void setWarehouseInfo(StockReceiptOrderDO stockReceiptOrderDO) {
|
||||
if (stockReceiptOrderDO.getWarehouseId() == null) {
|
||||
throw new ServiceException("仓库ID不能为空");
|
||||
}
|
||||
AjaxResult ajaxResult = systemServiceFeign.getWarehouseInfoByWarehouseId(stockReceiptOrderDO.getWarehouseId());
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取仓库信息失败");
|
||||
|
||||
+85
@@ -251,4 +251,89 @@ public class InMaterialDetail extends BaseVOEntity {
|
||||
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
|
||||
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
|
||||
private Long overStockType;
|
||||
|
||||
// ========== 报关相关明细字段 ==========
|
||||
@ApiModelProperty("规格型号/ITEM")
|
||||
@Excel(name = "规格型号/ITEM")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("商品SKU码")
|
||||
@Excel(name = "商品SKU码")
|
||||
private String skuCode;
|
||||
|
||||
@ApiModelProperty("Invoice No.")
|
||||
@Excel(name = "Invoice No.")
|
||||
private String invoiceNo;
|
||||
|
||||
@ApiModelProperty("升")
|
||||
@Excel(name = "升")
|
||||
private BigDecimal liter;
|
||||
|
||||
@ApiModelProperty("尺寸")
|
||||
@Excel(name = "尺寸")
|
||||
private String dimensions;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
@Excel(name = "申报单位")
|
||||
private String declaredUnit;
|
||||
|
||||
@ApiModelProperty("Batch Ref NO's")
|
||||
@Excel(name = "Batch Ref NO's")
|
||||
private String batchRefNo;
|
||||
|
||||
@ApiModelProperty("Sheet Ref NO's")
|
||||
@Excel(name = "Sheet Ref NO's")
|
||||
private String sheetRefNo;
|
||||
|
||||
@ApiModelProperty("原产国")
|
||||
@Excel(name = "原产国")
|
||||
private String countryOfOrigin;
|
||||
|
||||
@ApiModelProperty("箱号/卡板号")
|
||||
@Excel(name = "箱号/卡板号")
|
||||
private String boxPalletNo;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
@Excel(name = "币制")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("申报数量")
|
||||
@Excel(name = "申报数量")
|
||||
private BigDecimal declaredQuantity;
|
||||
|
||||
@ApiModelProperty("箱数")
|
||||
@Excel(name = "箱数")
|
||||
private BigDecimal boxCount;
|
||||
|
||||
@ApiModelProperty("件数")
|
||||
@Excel(name = "件数")
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
@ApiModelProperty("出库数量")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
@ApiModelProperty("总净重(KG)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
@ApiModelProperty("总毛重(KG)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
@ApiModelProperty("总体积(CBM)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
@ApiModelProperty("总面积(SQM)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@ApiModelProperty("总价")
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal totalPrice;
|
||||
}
|
||||
|
||||
+85
@@ -263,4 +263,89 @@ public class InMaterialDetailPO extends StockInOrderBasePO {
|
||||
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
|
||||
private Long overStockType;
|
||||
|
||||
// ========== 报关相关明细字段 ==========
|
||||
@ApiModelProperty("规格型号/ITEM")
|
||||
@Excel(name = "规格型号/ITEM")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("商品SKU码")
|
||||
@Excel(name = "商品SKU码")
|
||||
private String skuCode;
|
||||
|
||||
@ApiModelProperty("Invoice No.")
|
||||
@Excel(name = "Invoice No.")
|
||||
private String invoiceNo;
|
||||
|
||||
@ApiModelProperty("升")
|
||||
@Excel(name = "升")
|
||||
private BigDecimal liter;
|
||||
|
||||
@ApiModelProperty("尺寸")
|
||||
@Excel(name = "尺寸")
|
||||
private String dimensions;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
@Excel(name = "申报单位")
|
||||
private String declaredUnit;
|
||||
|
||||
@ApiModelProperty("Batch Ref NO's")
|
||||
@Excel(name = "Batch Ref NO's")
|
||||
private String batchRefNo;
|
||||
|
||||
@ApiModelProperty("Sheet Ref NO's")
|
||||
@Excel(name = "Sheet Ref NO's")
|
||||
private String sheetRefNo;
|
||||
|
||||
@ApiModelProperty("原产国")
|
||||
@Excel(name = "原产国")
|
||||
private String countryOfOrigin;
|
||||
|
||||
@ApiModelProperty("箱号/卡板号")
|
||||
@Excel(name = "箱号/卡板号")
|
||||
private String boxPalletNo;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
@Excel(name = "币制")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("申报数量")
|
||||
@Excel(name = "申报数量")
|
||||
private BigDecimal declaredQuantity;
|
||||
|
||||
@ApiModelProperty("箱数")
|
||||
@Excel(name = "箱数")
|
||||
private BigDecimal boxCount;
|
||||
|
||||
@ApiModelProperty("件数")
|
||||
@Excel(name = "件数")
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
@ApiModelProperty("出库数量")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
@ApiModelProperty("总净重(KG)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
@ApiModelProperty("总毛重(KG)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
@ApiModelProperty("总体积(CBM)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
@ApiModelProperty("总面积(SQM)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@ApiModelProperty("总价")
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
}
|
||||
|
||||
+85
@@ -258,4 +258,89 @@ public class InMaterialDetailDO extends StockInOrderBaseDO {
|
||||
@ApiModelProperty("入库单号集合")
|
||||
@Excel(name = "入库单号集合")
|
||||
private List<String> inOrderNumberList;
|
||||
|
||||
// ========== 报关相关明细字段 ==========
|
||||
@ApiModelProperty("规格型号/ITEM(选择物料后自动带出,不可编辑)")
|
||||
@Excel(name = "规格型号/ITEM")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("商品SKU码(选择物料后自动带出,不可编辑)")
|
||||
@Excel(name = "商品SKU码")
|
||||
private String skuCode;
|
||||
|
||||
@ApiModelProperty("Invoice No.")
|
||||
@Excel(name = "Invoice No.")
|
||||
private String invoiceNo;
|
||||
|
||||
@ApiModelProperty("升(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "升")
|
||||
private BigDecimal liter;
|
||||
|
||||
@ApiModelProperty("尺寸")
|
||||
@Excel(name = "尺寸")
|
||||
private String dimensions;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
@Excel(name = "申报单位")
|
||||
private String declaredUnit;
|
||||
|
||||
@ApiModelProperty("Batch Ref NO's")
|
||||
@Excel(name = "Batch Ref NO's")
|
||||
private String batchRefNo;
|
||||
|
||||
@ApiModelProperty("Sheet Ref NO's")
|
||||
@Excel(name = "Sheet Ref NO's")
|
||||
private String sheetRefNo;
|
||||
|
||||
@ApiModelProperty("原产国")
|
||||
@Excel(name = "原产国")
|
||||
private String countryOfOrigin;
|
||||
|
||||
@ApiModelProperty("箱号/卡板号")
|
||||
@Excel(name = "箱号/卡板号")
|
||||
private String boxPalletNo;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
@Excel(name = "币制")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty("单位(数据字典下拉选择框)")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("申报数量(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "申报数量")
|
||||
private BigDecimal declaredQuantity;
|
||||
|
||||
@ApiModelProperty("箱数(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "箱数")
|
||||
private BigDecimal boxCount;
|
||||
|
||||
@ApiModelProperty("件数(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "件数")
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
@ApiModelProperty("出库数量(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
@ApiModelProperty("总净重(KG)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
@ApiModelProperty("总毛重(KG)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
@ApiModelProperty("总体积(CBM)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
@ApiModelProperty("总面积(SQM)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@ApiModelProperty("总价(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal totalPrice;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mhd.wms.domain.stockInOrder.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
@@ -225,4 +226,104 @@ public class StockInOrder extends BaseVOEntity {
|
||||
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
|
||||
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
|
||||
private Long overStockType;
|
||||
|
||||
// ========== 报关相关字段 ==========
|
||||
@ApiModelProperty("To")
|
||||
@Excel(name = "To")
|
||||
@TableField(value = "\"TO\"")
|
||||
private String to;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
@ApiModelProperty("车型及车牌")
|
||||
@Excel(name = "车型及车牌")
|
||||
private String vehicleInfo;
|
||||
|
||||
@ApiModelProperty("委托编号NO")
|
||||
@Excel(name = "委托编号NO")
|
||||
private String consignmentNo;
|
||||
|
||||
@ApiModelProperty("Tel")
|
||||
@Excel(name = "Tel")
|
||||
private String tel;
|
||||
|
||||
@ApiModelProperty("司机签名")
|
||||
@Excel(name = "司机签名")
|
||||
private String driverSignature;
|
||||
|
||||
@ApiModelProperty("Fax")
|
||||
@Excel(name = "Fax")
|
||||
private String fax;
|
||||
|
||||
@ApiModelProperty("申报地关区")
|
||||
@Excel(name = "申报地关区")
|
||||
private String declarationArea;
|
||||
|
||||
@ApiModelProperty("生产商")
|
||||
@Excel(name = "生产商")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("报关员姓名及联系方式")
|
||||
@Excel(name = "报关员姓名及联系方式")
|
||||
private String customsBrokerInfo;
|
||||
|
||||
@ApiModelProperty("送货地址")
|
||||
@Excel(name = "送货地址")
|
||||
private String deliveryAddress;
|
||||
|
||||
@ApiModelProperty("进出境关别")
|
||||
@Excel(name = "进出境关别")
|
||||
private String entryExitCustoms;
|
||||
|
||||
@ApiModelProperty("起运/运抵国(地区)")
|
||||
@Excel(name = "起运/运抵国(地区)")
|
||||
private String originDestinationCountry;
|
||||
|
||||
@ApiModelProperty("承运商")
|
||||
@Excel(name = "承运商")
|
||||
private String carrier;
|
||||
|
||||
@ApiModelProperty("柜号")
|
||||
@Excel(name = "柜号")
|
||||
private String containerNo;
|
||||
|
||||
@ApiModelProperty("运输方式")
|
||||
@Excel(name = "运输方式")
|
||||
private String transportMethod;
|
||||
|
||||
@ApiModelProperty("监管方式")
|
||||
@Excel(name = "监管方式")
|
||||
private String supervisionMethod;
|
||||
|
||||
@ApiModelProperty("海关是否查验货物")
|
||||
@Excel(name = "海关是否查验货物")
|
||||
private Integer customsInspection;
|
||||
|
||||
@ApiModelProperty("是否需要报关")
|
||||
@Excel(name = "是否需要报关")
|
||||
private Integer needCustomsDeclaration;
|
||||
|
||||
@ApiModelProperty("是否需要运输")
|
||||
@Excel(name = "是否需要运输")
|
||||
private Integer needTransport;
|
||||
|
||||
@ApiModelProperty("入仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date warehouseDate;
|
||||
|
||||
@ApiModelProperty("完成时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date completionTime;
|
||||
|
||||
@ApiModelProperty("下单日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderDate;
|
||||
}
|
||||
|
||||
+99
@@ -226,4 +226,103 @@ public class StockInOrderPO extends BaseVOEntity {
|
||||
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
|
||||
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
|
||||
private Long overStockType;
|
||||
|
||||
// ========== 报关相关字段 ==========
|
||||
@ApiModelProperty("To")
|
||||
@Excel(name = "To")
|
||||
private String to;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
@ApiModelProperty("车型及车牌")
|
||||
@Excel(name = "车型及车牌")
|
||||
private String vehicleInfo;
|
||||
|
||||
@ApiModelProperty("委托编号NO")
|
||||
@Excel(name = "委托编号NO")
|
||||
private String consignmentNo;
|
||||
|
||||
@ApiModelProperty("Tel")
|
||||
@Excel(name = "Tel")
|
||||
private String tel;
|
||||
|
||||
@ApiModelProperty("司机签名")
|
||||
@Excel(name = "司机签名")
|
||||
private String driverSignature;
|
||||
|
||||
@ApiModelProperty("Fax")
|
||||
@Excel(name = "Fax")
|
||||
private String fax;
|
||||
|
||||
@ApiModelProperty("申报地关区")
|
||||
@Excel(name = "申报地关区")
|
||||
private String declarationArea;
|
||||
|
||||
@ApiModelProperty("生产商")
|
||||
@Excel(name = "生产商")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("报关员姓名及联系方式")
|
||||
@Excel(name = "报关员姓名及联系方式")
|
||||
private String customsBrokerInfo;
|
||||
|
||||
@ApiModelProperty("送货地址")
|
||||
@Excel(name = "送货地址")
|
||||
private String deliveryAddress;
|
||||
|
||||
@ApiModelProperty("进出境关别")
|
||||
@Excel(name = "进出境关别")
|
||||
private String entryExitCustoms;
|
||||
|
||||
@ApiModelProperty("起运/运抵国(地区)")
|
||||
@Excel(name = "起运/运抵国(地区)")
|
||||
private String originDestinationCountry;
|
||||
|
||||
@ApiModelProperty("承运商")
|
||||
@Excel(name = "承运商")
|
||||
private String carrier;
|
||||
|
||||
@ApiModelProperty("柜号")
|
||||
@Excel(name = "柜号")
|
||||
private String containerNo;
|
||||
|
||||
@ApiModelProperty("运输方式")
|
||||
@Excel(name = "运输方式")
|
||||
private String transportMethod;
|
||||
|
||||
@ApiModelProperty("监管方式")
|
||||
@Excel(name = "监管方式")
|
||||
private String supervisionMethod;
|
||||
|
||||
@ApiModelProperty("海关是否查验货物")
|
||||
@Excel(name = "海关是否查验货物")
|
||||
private Integer customsInspection;
|
||||
|
||||
@ApiModelProperty("是否需要报关")
|
||||
@Excel(name = "是否需要报关")
|
||||
private Integer needCustomsDeclaration;
|
||||
|
||||
@ApiModelProperty("是否需要运输")
|
||||
@Excel(name = "是否需要运输")
|
||||
private Integer needTransport;
|
||||
|
||||
@ApiModelProperty("入仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date warehouseDate;
|
||||
|
||||
@ApiModelProperty("完成时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date completionTime;
|
||||
|
||||
@ApiModelProperty("下单日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderDate;
|
||||
}
|
||||
|
||||
+99
@@ -241,4 +241,103 @@ public class StockInOrderDO extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("调度单号")
|
||||
private String mobilizeCode;
|
||||
|
||||
// ========== 报关相关字段 ==========
|
||||
@ApiModelProperty("To")
|
||||
@Excel(name = "To")
|
||||
private String to;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
@ApiModelProperty("车型及车牌")
|
||||
@Excel(name = "车型及车牌")
|
||||
private String vehicleInfo;
|
||||
|
||||
@ApiModelProperty("委托编号NO")
|
||||
@Excel(name = "委托编号NO")
|
||||
private String consignmentNo;
|
||||
|
||||
@ApiModelProperty("Tel")
|
||||
@Excel(name = "Tel")
|
||||
private String tel;
|
||||
|
||||
@ApiModelProperty("司机签名")
|
||||
@Excel(name = "司机签名")
|
||||
private String driverSignature;
|
||||
|
||||
@ApiModelProperty("Fax")
|
||||
@Excel(name = "Fax")
|
||||
private String fax;
|
||||
|
||||
@ApiModelProperty("申报地关区")
|
||||
@Excel(name = "申报地关区")
|
||||
private String declarationArea;
|
||||
|
||||
@ApiModelProperty("生产商")
|
||||
@Excel(name = "生产商")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("报关员姓名及联系方式")
|
||||
@Excel(name = "报关员姓名及联系方式")
|
||||
private String customsBrokerInfo;
|
||||
|
||||
@ApiModelProperty("送货地址")
|
||||
@Excel(name = "送货地址")
|
||||
private String deliveryAddress;
|
||||
|
||||
@ApiModelProperty("进出境关别")
|
||||
@Excel(name = "进出境关别")
|
||||
private String entryExitCustoms;
|
||||
|
||||
@ApiModelProperty("起运/运抵国(地区)")
|
||||
@Excel(name = "起运/运抵国(地区)")
|
||||
private String originDestinationCountry;
|
||||
|
||||
@ApiModelProperty("承运商(先做成输入框,待定)")
|
||||
@Excel(name = "承运商")
|
||||
private String carrier;
|
||||
|
||||
@ApiModelProperty("柜号(数据字典:20尺/40尺)")
|
||||
@Excel(name = "柜号")
|
||||
private String containerNo;
|
||||
|
||||
@ApiModelProperty("运输方式(数据字典:公路运输/其他运输)")
|
||||
@Excel(name = "运输方式")
|
||||
private String transportMethod;
|
||||
|
||||
@ApiModelProperty("监管方式(数据字典:一般贸易)")
|
||||
@Excel(name = "监管方式")
|
||||
private String supervisionMethod;
|
||||
|
||||
@ApiModelProperty("海关是否查验货物(默认:否)")
|
||||
@Excel(name = "海关是否查验货物")
|
||||
private Integer customsInspection;
|
||||
|
||||
@ApiModelProperty("是否需要报关(默认:是)")
|
||||
@Excel(name = "是否需要报关")
|
||||
private Integer needCustomsDeclaration;
|
||||
|
||||
@ApiModelProperty("是否需要运输(默认:否)")
|
||||
@Excel(name = "是否需要运输")
|
||||
private Integer needTransport;
|
||||
|
||||
@ApiModelProperty("入仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date warehouseDate;
|
||||
|
||||
@ApiModelProperty("完成时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date completionTime;
|
||||
|
||||
@ApiModelProperty("下单日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderDate;
|
||||
}
|
||||
|
||||
+84
-28
@@ -31,6 +31,7 @@ import com.mhd.wms.domain.stockInOrder.entity.StockInOrder;
|
||||
import com.mhd.wms.domain.stockInOrder.repository.facade.IStockInOrderService;
|
||||
import com.mhd.wms.domain.stockInOrder.repository.po.StockInOrderPO;
|
||||
import com.mhd.wms.domain.stockInOrder.repository.todo.StockInOrderDO;
|
||||
import com.mhd.wms.domain.stockReceiptOrder.repository.po.StockReceiptOrderPO;
|
||||
import com.mhd.wms.domain.stockReceiptOrder.repository.todo.StockReceiptOrderDO;
|
||||
import com.mhd.wms.domain.stockReceiptOrder.service.StockReceiptOrderDomainService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -84,19 +85,21 @@ public class StockInOrderDomainService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insert(StockInOrderDO stockInOrderDO) {
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
//设置物料信息
|
||||
setMaterialDetailInfo(stockInOrderDO);
|
||||
//统计总物料种数
|
||||
stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
|
||||
//统计总计划数
|
||||
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderDO.setQuantity(quantity);
|
||||
//统计总重量
|
||||
BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderDO.setWeightLimit(weightLimit);
|
||||
//统计总体积
|
||||
BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderDO.setVolumeLimit(volumeLimit);
|
||||
// //设置默认值
|
||||
// setDefaultValues(stockInOrderDO);
|
||||
// //设置物料信息
|
||||
// setMaterialDetailInfo(stockInOrderDO);
|
||||
// //统计总物料种数
|
||||
// stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
|
||||
// //统计总计划数
|
||||
// BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// stockInOrderDO.setQuantity(quantity);
|
||||
// //统计总重量
|
||||
// BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// stockInOrderDO.setWeightLimit(weightLimit);
|
||||
// //统计总体积
|
||||
// BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// stockInOrderDO.setVolumeLimit(volumeLimit);
|
||||
stockInOrderService.insert(stockInOrderDO);
|
||||
return materialDetailService.batchInsert(stockInOrderDO.getInOrderNumber(), stockInOrderDO.getMaterialDetailList());
|
||||
}
|
||||
@@ -110,19 +113,19 @@ public class StockInOrderDomainService {
|
||||
if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){
|
||||
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
|
||||
}
|
||||
//设置物料信息
|
||||
setMaterialDetailInfo(stockInOrderDO);
|
||||
//统计总物料种数
|
||||
stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
|
||||
//统计总计划数
|
||||
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderDO.setQuantity(quantity);
|
||||
//统计总重量
|
||||
BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderDO.setWeightLimit(weightLimit);
|
||||
//统计总体积
|
||||
BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderDO.setVolumeLimit(volumeLimit);
|
||||
// //设置物料信息
|
||||
// setMaterialDetailInfo(stockInOrderDO);
|
||||
// //统计总物料种数
|
||||
// stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
|
||||
// //统计总计划数
|
||||
// BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// stockInOrderDO.setQuantity(quantity);
|
||||
// //统计总重量
|
||||
// BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// stockInOrderDO.setWeightLimit(weightLimit);
|
||||
// //统计总体积
|
||||
// BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// stockInOrderDO.setVolumeLimit(volumeLimit);
|
||||
stockInOrderService.insert(stockInOrderDO);
|
||||
materialDetailService.batchInsert(stockInOrderDO.getInOrderNumber(), stockInOrderDO.getMaterialDetailList());
|
||||
}
|
||||
@@ -143,7 +146,7 @@ public class StockInOrderDomainService {
|
||||
//统计总物料种数
|
||||
stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
|
||||
//统计总计划数
|
||||
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(InMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockInOrderPO.setQuantity(quantity);
|
||||
stockInOrderDO.setQuantity(quantity);
|
||||
//统计总重量
|
||||
@@ -304,7 +307,25 @@ public class StockInOrderDomainService {
|
||||
});
|
||||
//判断物流是否需要生成质检单
|
||||
genQualityInspection(stockReceiptOrderDOList);
|
||||
return stockReceiptOrderDomainService.batchInsert(stockReceiptOrderDOList);
|
||||
//生成收货单
|
||||
Boolean batchInsertResult = stockReceiptOrderDomainService.batchInsert(stockReceiptOrderDOList);
|
||||
if (!batchInsertResult) {
|
||||
throw new ServiceException("生成收货单失败");
|
||||
}
|
||||
//生成收货任务:根据入库单号查询刚生成的收货单
|
||||
List<StockReceiptOrderPO> stockReceiptOrderPOList = new ArrayList<>();
|
||||
for (String inOrderNumber : inOrderNumberList) {
|
||||
StockReceiptOrderDO stockReceiptOrderDOQuery = new StockReceiptOrderDO();
|
||||
stockReceiptOrderDOQuery.setInOrderNumber(inOrderNumber);
|
||||
List<StockReceiptOrderPO> receiptOrderList = stockReceiptOrderDomainService.queryList(stockReceiptOrderDOQuery);
|
||||
if (!CollectionUtils.isEmpty(receiptOrderList)) {
|
||||
stockReceiptOrderPOList.addAll(receiptOrderList);
|
||||
}
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(stockReceiptOrderPOList)) {
|
||||
stockReceiptOrderDomainService.genStockReceiptTaskOrder(stockReceiptOrderPOList);
|
||||
}
|
||||
return batchInsertResult;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -385,7 +406,42 @@ public class StockInOrderDomainService {
|
||||
inMaterialDetailDO.setDistributeRuleId(materialGoodsRulePO.getMaterialGoodsRuleId());
|
||||
inMaterialDetailDO.setDistributeRuleCode(materialGoodsRulePO.getRuleCode());
|
||||
inMaterialDetailDO.setDistributeRuleName(materialGoodsRulePO.getRuleName());
|
||||
|
||||
//自动填充规格型号和SKU码(如果物料基础信息中有相关字段且明细中未设置)
|
||||
//规格型号:优先使用物料种类名称,如果为空则使用物料类型名称
|
||||
if (StringUtils.isBlank(inMaterialDetailDO.getSpecification())) {
|
||||
if (StringUtils.isNotBlank(materialBaseInfoPO.getMaterialTypeName())) {
|
||||
inMaterialDetailDO.setSpecification(materialBaseInfoPO.getMaterialTypeName());
|
||||
}
|
||||
}
|
||||
//商品SKU码:使用物料条形码
|
||||
if (StringUtils.isBlank(inMaterialDetailDO.getSkuCode())) {
|
||||
if (StringUtils.isNotBlank(materialBaseInfoPO.getBarCode())) {
|
||||
inMaterialDetailDO.setSkuCode(materialBaseInfoPO.getBarCode());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置默认值
|
||||
* @author gen
|
||||
* @date 2026/1/16
|
||||
* @param stockInOrderDO
|
||||
*/
|
||||
private void setDefaultValues(StockInOrderDO stockInOrderDO) {
|
||||
//海关是否查验货物(默认:0=否)
|
||||
if (stockInOrderDO.getCustomsInspection() == null) {
|
||||
stockInOrderDO.setCustomsInspection(0);
|
||||
}
|
||||
//是否需要报关(默认:1=是)
|
||||
if (stockInOrderDO.getNeedCustomsDeclaration() == null) {
|
||||
stockInOrderDO.setNeedCustomsDeclaration(1);
|
||||
}
|
||||
//是否需要运输(默认:0=否)
|
||||
if (stockInOrderDO.getNeedTransport() == null) {
|
||||
stockInOrderDO.setNeedTransport(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+85
@@ -263,4 +263,89 @@ public class InMaterialDetailDTO extends BaseVOEntity {
|
||||
@ApiModelProperty("是否是差异单")
|
||||
private Integer isDifferentType;
|
||||
|
||||
// ========== 报关相关明细字段 ==========
|
||||
@ApiModelProperty("规格型号/ITEM(选择物料后自动带出,不可编辑)")
|
||||
@Excel(name = "规格型号/ITEM")
|
||||
private String specification;
|
||||
|
||||
@ApiModelProperty("商品SKU码(选择物料后自动带出,不可编辑)")
|
||||
@Excel(name = "商品SKU码")
|
||||
private String skuCode;
|
||||
|
||||
@ApiModelProperty("Invoice No.")
|
||||
@Excel(name = "Invoice No.")
|
||||
private String invoiceNo;
|
||||
|
||||
@ApiModelProperty("升(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "升")
|
||||
private BigDecimal liter;
|
||||
|
||||
@ApiModelProperty("尺寸")
|
||||
@Excel(name = "尺寸")
|
||||
private String dimensions;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
@Excel(name = "申报单位")
|
||||
private String declaredUnit;
|
||||
|
||||
@ApiModelProperty("Batch Ref NO's")
|
||||
@Excel(name = "Batch Ref NO's")
|
||||
private String batchRefNo;
|
||||
|
||||
@ApiModelProperty("Sheet Ref NO's")
|
||||
@Excel(name = "Sheet Ref NO's")
|
||||
private String sheetRefNo;
|
||||
|
||||
@ApiModelProperty("原产国")
|
||||
@Excel(name = "原产国")
|
||||
private String countryOfOrigin;
|
||||
|
||||
@ApiModelProperty("箱号/卡板号")
|
||||
@Excel(name = "箱号/卡板号")
|
||||
private String boxPalletNo;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
@Excel(name = "币制")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty("单位(数据字典下拉选择框)")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("申报数量(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "申报数量")
|
||||
private BigDecimal declaredQuantity;
|
||||
|
||||
@ApiModelProperty("箱数(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "箱数")
|
||||
private BigDecimal boxCount;
|
||||
|
||||
@ApiModelProperty("件数(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "件数")
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
@ApiModelProperty("出库数量(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
@ApiModelProperty("总净重(KG)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
@ApiModelProperty("总毛重(KG)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
@ApiModelProperty("总体积(CBM)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
@ApiModelProperty("总面积(SQM)(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private BigDecimal totalArea;
|
||||
|
||||
@ApiModelProperty("总价(输入大于等于0的数字,可以为小数)")
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
}
|
||||
|
||||
@@ -237,4 +237,104 @@ public class StockInOrderDTO extends StockInOrderBaseDTO {
|
||||
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
|
||||
private Integer gtAuditStatus;
|
||||
|
||||
// ========== 报关相关字段 ==========
|
||||
@ApiModelProperty("To")
|
||||
@Excel(name = "To")
|
||||
private String to;
|
||||
|
||||
@ApiModelProperty("联系人")
|
||||
@Excel(name = "联系人")
|
||||
private String contactPerson;
|
||||
|
||||
@ApiModelProperty("车型及车牌")
|
||||
@Excel(name = "车型及车牌")
|
||||
private String vehicleInfo;
|
||||
|
||||
@ApiModelProperty("委托编号NO")
|
||||
@Excel(name = "委托编号NO")
|
||||
private String consignmentNo;
|
||||
|
||||
@ApiModelProperty("Tel")
|
||||
@Excel(name = "Tel")
|
||||
private String tel;
|
||||
|
||||
@ApiModelProperty("司机签名")
|
||||
@Excel(name = "司机签名")
|
||||
private String driverSignature;
|
||||
|
||||
@ApiModelProperty("Fax")
|
||||
@Excel(name = "Fax")
|
||||
private String fax;
|
||||
|
||||
@ApiModelProperty("申报地关区")
|
||||
@Excel(name = "申报地关区")
|
||||
private String declarationArea;
|
||||
|
||||
|
||||
@ApiModelProperty("生产商")
|
||||
@Excel(name = "生产商")
|
||||
private String manufacturer;
|
||||
|
||||
@ApiModelProperty("报关员姓名及联系方式")
|
||||
@Excel(name = "报关员姓名及联系方式")
|
||||
private String customsBrokerInfo;
|
||||
|
||||
@ApiModelProperty("送货地址")
|
||||
@Excel(name = "送货地址")
|
||||
private String deliveryAddress;
|
||||
|
||||
@ApiModelProperty("进出境关别")
|
||||
@Excel(name = "进出境关别")
|
||||
private String entryExitCustoms;
|
||||
|
||||
@ApiModelProperty("起运/运抵国(地区)")
|
||||
@Excel(name = "起运/运抵国(地区)")
|
||||
private String originDestinationCountry;
|
||||
|
||||
@ApiModelProperty("承运商(先做成输入框,待定)")
|
||||
@Excel(name = "承运商")
|
||||
private String carrier;
|
||||
|
||||
@ApiModelProperty("柜号(数据字典:20尺/40尺)")
|
||||
@Excel(name = "柜号")
|
||||
private String containerNo;
|
||||
|
||||
@ApiModelProperty("运输方式(数据字典:公路运输/其他运输)")
|
||||
@Excel(name = "运输方式")
|
||||
private String transportMethod;
|
||||
|
||||
@ApiModelProperty("监管方式(数据字典:一般贸易)")
|
||||
@Excel(name = "监管方式")
|
||||
private String supervisionMethod;
|
||||
|
||||
@ApiModelProperty("海关是否查验货物(默认:否)")
|
||||
@Excel(name = "海关是否查验货物")
|
||||
private Integer customsInspection;
|
||||
|
||||
@ApiModelProperty("是否需要报关(默认:是)")
|
||||
@Excel(name = "是否需要报关")
|
||||
private Integer needCustomsDeclaration;
|
||||
|
||||
@ApiModelProperty("是否需要运输(默认:否)")
|
||||
@Excel(name = "是否需要运输")
|
||||
private Integer needTransport;
|
||||
|
||||
@ApiModelProperty("入仓日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date warehouseDate;
|
||||
|
||||
@ApiModelProperty("完成时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date completionTime;
|
||||
|
||||
@ApiModelProperty("下单日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderDate;
|
||||
}
|
||||
|
||||
+12
@@ -3,6 +3,8 @@ package com.mhd.wms.interfaces.facadeApi.stockInOrder;
|
||||
import com.mhd.common.core.web.controller.BaseController;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.wms.application.service.stockInOrder.StockInOrderApplicationService;
|
||||
import com.mhd.wms.domain.stockInOrder.repository.po.StockInOrderPO;
|
||||
import com.mhd.wms.domain.stockInOrder.repository.todo.StockInOrderDO;
|
||||
@@ -11,6 +13,7 @@ import com.mhd.wms.interfaces.dto.stockInOrder.StockInOrderDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
@@ -80,6 +83,15 @@ public class StockInOrderApi extends BaseController {
|
||||
return AjaxResult.success(stockInOrderApplicationService.getInfo(inOrderId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入入库单
|
||||
*/
|
||||
@ApiOperation("导入入库单")
|
||||
@PostMapping(value = "/importData")
|
||||
public AjaxResult importData(MultipartFile file)
|
||||
{
|
||||
return AjaxResult.success(stockInOrderApplicationService.importData(file));
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核入库单
|
||||
|
||||
@@ -52,6 +52,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="overStockId" column="over_stock_id" />
|
||||
<result property="overStockStatus" column="over_stock_status" />
|
||||
<result property="overStockType" column="over_stock_type" />
|
||||
<result property="specification" column="SPECIFICATION" />
|
||||
<result property="skuCode" column="SKU_CODE" />
|
||||
<result property="invoiceNo" column="INVOICE_NO" />
|
||||
<result property="liter" column="LITER" />
|
||||
<result property="dimensions" column="DIMENSIONS" />
|
||||
<result property="declaredUnit" column="DECLARED_UNIT" />
|
||||
<result property="batchRefNo" column="BATCH_REF_NO" />
|
||||
<result property="sheetRefNo" column="SHEET_REF_NO" />
|
||||
<result property="countryOfOrigin" column="COUNTRY_OF_ORIGIN" />
|
||||
<result property="boxPalletNo" column="BOX_PALLET_NO" />
|
||||
<result property="currency" column="CURRENCY" />
|
||||
<result property="unit" column="UNIT" />
|
||||
<result property="declaredQuantity" column="DECLARED_QUANTITY" />
|
||||
<result property="boxCount" column="BOX_COUNT" />
|
||||
<result property="pieceCount" column="PIECE_COUNT" />
|
||||
<result property="outboundQuantity" column="OUTBOUND_QUANTITY" />
|
||||
<result property="totalNetWeight" column="TOTAL_NET_WEIGHT" />
|
||||
<result property="totalGrossWeight" column="TOTAL_GROSS_WEIGHT" />
|
||||
<result property="totalVolume" column="TOTAL_VOLUME" />
|
||||
<result property="totalArea" column="TOTAL_AREA" />
|
||||
<result property="totalPrice" column="TOTAL_PRICE" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -64,7 +85,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.overcharge_ratio, a.batch_number, a.material_status_code, a.material_status_name, a.distribute_rule_id, a.distribute_rule_code,
|
||||
a.distribute_rule_name, a.container_id, a.container_code, a.container_type, a.container_type_name,
|
||||
a.warehouse_id, a.warehouse_code, a.warehouse_name, a.storage_section_id, a.storage_code, a.storage_name, a.storage_location_id, a.storage_location_code, a.storage_location_name,
|
||||
a.level, a.parent_unique_id, a.remark, a.create_time, a.create_by,a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type
|
||||
a.level, a.parent_unique_id, a.remark, a.create_time, a.create_by,a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type,
|
||||
a.SPECIFICATION, a.SKU_CODE, a.INVOICE_NO, a.LITER, a.DIMENSIONS, a.DECLARED_UNIT, a.BATCH_REF_NO, a.SHEET_REF_NO,
|
||||
a.COUNTRY_OF_ORIGIN, a.BOX_PALLET_NO, a.CURRENCY, a.UNIT, a.DECLARED_QUANTITY, a.BOX_COUNT, a.PIECE_COUNT, a.OUTBOUND_QUANTITY,
|
||||
a.TOTAL_NET_WEIGHT, a.TOTAL_GROSS_WEIGHT, a.TOTAL_VOLUME, a.TOTAL_AREA, a.TOTAL_PRICE
|
||||
,CASE
|
||||
WHEN (a.quantity - a.receipt_quantity) < 0 THEN 0
|
||||
ELSE (a.quantity - a.receipt_quantity)
|
||||
|
||||
@@ -54,6 +54,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="overStockId" column="over_stock_id" />
|
||||
<result property="overStockStatus" column="over_stock_status" />
|
||||
<result property="overStockType" column="over_stock_type" />
|
||||
<result property="to" column="TO" />
|
||||
<result property="contactPerson" column="CONTACT_PERSON" />
|
||||
<result property="vehicleInfo" column="VEHICLE_INFO" />
|
||||
<result property="consignmentNo" column="CONSIGNMENT_NO" />
|
||||
<result property="tel" column="TEL" />
|
||||
<result property="driverSignature" column="DRIVER_SIGNATURE" />
|
||||
<result property="fax" column="FAX" />
|
||||
<result property="declarationArea" column="DECLARATION_AREA" />
|
||||
<result property="manufacturer" column="MANUFACTURER" />
|
||||
<result property="customsBrokerInfo" column="CUSTOMS_BROKER_INFO" />
|
||||
<result property="deliveryAddress" column="DELIVERY_ADDRESS" />
|
||||
<result property="entryExitCustoms" column="ENTRY_EXIT_CUSTOMS" />
|
||||
<result property="originDestinationCountry" column="ORIGIN_DESTINATION_COUNTRY" />
|
||||
<result property="carrier" column="CARRIER" />
|
||||
<result property="containerNo" column="CONTAINER_NO" />
|
||||
<result property="transportMethod" column="TRANSPORT_METHOD" />
|
||||
<result property="supervisionMethod" column="SUPERVISION_METHOD" />
|
||||
<result property="customsInspection" column="CUSTOMS_INSPECTION" />
|
||||
<result property="needCustomsDeclaration" column="NEED_CUSTOMS_DECLARATION" />
|
||||
<result property="needTransport" column="NEED_TRANSPORT" />
|
||||
<result property="warehouseDate" column="WAREHOUSE_DATE" />
|
||||
<result property="completionTime" column="COMPLETION_TIME" />
|
||||
<result property="orderDate" column="ORDER_DATE" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -63,13 +86,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.shipper_name, a.order_type_code, a.order_type_name, a.supplier_id, a.supplier_code, a.supplier_name, a.expect_time, a.supply_chain_number,
|
||||
a.priority_level_code, a.priority_level_name, a.direct_warehouse, a.annex_url, a.material_quantity, a.quantity, a.weight_limit, a.volume_limit, a.cancel_order, a.cancel_remark, a.cancel_by,
|
||||
a.cancel_by_name, a.cancel_time, a.close_order, a.close_remark, a.close_by, a.close_by_name, a.close_time, a.remark, a.create_time, a.create_by,
|
||||
a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, over_stock_id, over_stock_status, over_stock_type
|
||||
a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, over_stock_id, over_stock_status, over_stock_type,
|
||||
a."TO", a.CONTACT_PERSON, a.VEHICLE_INFO, a.CONSIGNMENT_NO, a.TEL, a.DRIVER_SIGNATURE, a.FAX, a.DECLARATION_AREA, a.MANUFACTURER,
|
||||
a.CUSTOMS_BROKER_INFO, a.DELIVERY_ADDRESS, a.ENTRY_EXIT_CUSTOMS, a.ORIGIN_DESTINATION_COUNTRY, a.CARRIER, a.CONTAINER_NO,
|
||||
a.TRANSPORT_METHOD, a.SUPERVISION_METHOD, a.CUSTOMS_INSPECTION, a.NEED_CUSTOMS_DECLARATION, a.NEED_TRANSPORT,
|
||||
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE
|
||||
</sql>
|
||||
|
||||
<sql id="joinStockInOrderPo">
|
||||
,b.notice_number, b.warehouse_id, b.warehouse_code, b.warehouse_name, b.shipper_id, b.shipper_code, b.shipper_name,
|
||||
b.order_type_code, b.order_type_name, b.supplier_id, b.supplier_code, b.supplier_name, b.expect_time, b.supply_chain_number, b.priority_level_code,
|
||||
b.priority_level_name, b.direct_warehouse, b.annex_url, b.material_quantity, b.quantity
|
||||
b.priority_level_name, b.direct_warehouse, b.annex_url, b.material_quantity as in_order_material_quantity, b.quantity as in_order_quantity
|
||||
</sql>
|
||||
|
||||
<sql id="joinStockInOrderPoWhere">
|
||||
@@ -266,6 +293,76 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- 报关相关字段查询条件 -->
|
||||
<if test="to != null and to != ''">
|
||||
and a."TO" like concat('%', #{to}, '%')
|
||||
</if>
|
||||
<if test="contactPerson != null and contactPerson != ''">
|
||||
and a.CONTACT_PERSON like concat('%', #{contactPerson}, '%')
|
||||
</if>
|
||||
<if test="vehicleInfo != null and vehicleInfo != ''">
|
||||
and a.VEHICLE_INFO like concat('%', #{vehicleInfo}, '%')
|
||||
</if>
|
||||
<if test="consignmentNo != null and consignmentNo != ''">
|
||||
and a.CONSIGNMENT_NO like concat('%', #{consignmentNo}, '%')
|
||||
</if>
|
||||
<if test="tel != null and tel != ''">
|
||||
and a.TEL like concat('%', #{tel}, '%')
|
||||
</if>
|
||||
<if test="driverSignature != null and driverSignature != ''">
|
||||
and a.DRIVER_SIGNATURE like concat('%', #{driverSignature}, '%')
|
||||
</if>
|
||||
<if test="fax != null and fax != ''">
|
||||
and a.FAX like concat('%', #{fax}, '%')
|
||||
</if>
|
||||
<if test="declarationArea != null and declarationArea != ''">
|
||||
and a.DECLARATION_AREA like concat('%', #{declarationArea}, '%')
|
||||
</if>
|
||||
<if test="manufacturer != null and manufacturer != ''">
|
||||
and a.MANUFACTURER like concat('%', #{manufacturer}, '%')
|
||||
</if>
|
||||
<if test="customsBrokerInfo != null and customsBrokerInfo != ''">
|
||||
and a.CUSTOMS_BROKER_INFO like concat('%', #{customsBrokerInfo}, '%')
|
||||
</if>
|
||||
<if test="deliveryAddress != null and deliveryAddress != ''">
|
||||
and a.DELIVERY_ADDRESS like concat('%', #{deliveryAddress}, '%')
|
||||
</if>
|
||||
<if test="entryExitCustoms != null and entryExitCustoms != ''">
|
||||
and a.ENTRY_EXIT_CUSTOMS like concat('%', #{entryExitCustoms}, '%')
|
||||
</if>
|
||||
<if test="originDestinationCountry != null and originDestinationCountry != ''">
|
||||
and a.ORIGIN_DESTINATION_COUNTRY like concat('%', #{originDestinationCountry}, '%')
|
||||
</if>
|
||||
<if test="carrier != null and carrier != ''">
|
||||
and a.CARRIER like concat('%', #{carrier}, '%')
|
||||
</if>
|
||||
<if test="containerNo != null and containerNo != ''">
|
||||
and a.CONTAINER_NO = #{containerNo}
|
||||
</if>
|
||||
<if test="transportMethod != null and transportMethod != ''">
|
||||
and a.TRANSPORT_METHOD = #{transportMethod}
|
||||
</if>
|
||||
<if test="supervisionMethod != null and supervisionMethod != ''">
|
||||
and a.SUPERVISION_METHOD = #{supervisionMethod}
|
||||
</if>
|
||||
<if test="customsInspection != null">
|
||||
and a.CUSTOMS_INSPECTION = #{customsInspection}
|
||||
</if>
|
||||
<if test="needCustomsDeclaration != null">
|
||||
and a.NEED_CUSTOMS_DECLARATION = #{needCustomsDeclaration}
|
||||
</if>
|
||||
<if test="needTransport != null">
|
||||
and a.NEED_TRANSPORT = #{needTransport}
|
||||
</if>
|
||||
<if test="warehouseDate != null">
|
||||
and a.WAREHOUSE_DATE = #{warehouseDate}
|
||||
</if>
|
||||
<if test="completionTime != null">
|
||||
and a.COMPLETION_TIME = #{completionTime}
|
||||
</if>
|
||||
<if test="orderDate != null">
|
||||
and a.ORDER_DATE = #{orderDate}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||
<otherwise> and a.del_flag = 1 </otherwise>
|
||||
|
||||
@@ -18,9 +18,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="platformUseStartTime" column="platform_use_start_time" />
|
||||
<result property="platformUseEndTime" column="platform_use_end_time" />
|
||||
<result property="platformUseStatus" column="platform_use_status" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="receiptQuantity" column="receipt_quantity" />
|
||||
<result property="receiptMaterialQuantity" column="receipt_material_quantity" />
|
||||
<result property="materialQuantity" column="material_quantity" />
|
||||
<result property="abnormal" column="abnormal" />
|
||||
<result property="taskDistribution" column="task_distribution" />
|
||||
<result property="taskDistributionTime" column="task_distribution_time" />
|
||||
<result property="operatorsBy" column="operators_by" />
|
||||
<result property="operatorsName" column="operators_name" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
|
||||
Reference in New Issue
Block a user