出库明细;
This commit is contained in:
+4
-4
@@ -91,9 +91,9 @@ public class StockOutOrderApplicationService {
|
||||
//设置仓库
|
||||
//setWarehouseInfo(stockOutOrderDO);
|
||||
//设置货主信息
|
||||
//shipperParam(stockOutOrderDO);
|
||||
shipperParam(stockOutOrderDO);
|
||||
//设置客户信息
|
||||
//customerParam(stockOutOrderDO);
|
||||
customerParam(stockOutOrderDO);
|
||||
//设置数据字典键值
|
||||
//setDataDict(stockOutOrderDO);
|
||||
return stockOutOrderDomainService.insert(stockOutOrderDO);
|
||||
@@ -403,7 +403,7 @@ public class StockOutOrderApplicationService {
|
||||
* @param stockOutOrderDO
|
||||
*/
|
||||
private void shipperParam(StockOutOrderDO stockOutOrderDO){
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(stockOutOrderDO.getShipperId());
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(Long.valueOf(stockOutOrderDO.getCustomerName()));
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取货主信息失败");
|
||||
}
|
||||
@@ -419,7 +419,7 @@ public class StockOutOrderApplicationService {
|
||||
* @param stockOutOrderDO
|
||||
*/
|
||||
private void customerParam(StockOutOrderDO stockOutOrderDO){
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(stockOutOrderDO.getCustomerId());
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(Long.valueOf(stockOutOrderDO.getCustomerName()));
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取客户信息失败");
|
||||
}
|
||||
|
||||
+9
-9
@@ -321,62 +321,62 @@ public class OutMaterialDetail extends BaseVOEntity {
|
||||
*/
|
||||
@ApiModelProperty("申报数量")
|
||||
@Excel(name = "申报数量")
|
||||
private Double declareQuantity;
|
||||
private BigDecimal declareQuantity;
|
||||
|
||||
/**
|
||||
* 箱数
|
||||
*/
|
||||
@ApiModelProperty("箱数")
|
||||
@Excel(name = "箱数")
|
||||
private Double caseCount;
|
||||
private BigDecimal caseCount;
|
||||
|
||||
/**
|
||||
* 件数
|
||||
*/
|
||||
@ApiModelProperty("件数")
|
||||
@Excel(name = "件数")
|
||||
private Double pieceCount;
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
@ApiModelProperty("出库数量")
|
||||
@Excel(name = "出库数量")
|
||||
private Double outboundQuantity;
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
/**
|
||||
* 总净重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总净重(KG)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private Double totalNetWeight;
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
/**
|
||||
* 总毛重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总毛重(KG)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private Double totalGrossWeight;
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
/**
|
||||
* 总体积(CBM)
|
||||
*/
|
||||
@ApiModelProperty("总体积(CBM)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private Double totalVolume;
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
/**
|
||||
* 总面积(SQM)
|
||||
*/
|
||||
@ApiModelProperty("总面积(SQM)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private Double totalArea;
|
||||
private BigDecimal totalArea;
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
@ApiModelProperty("总价")
|
||||
@Excel(name = "总价")
|
||||
private Double totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
|
||||
+34
-1
@@ -12,6 +12,10 @@ import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.utils.uuid.IdGenerator;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.materialInventory.entity.MaterialInventory;
|
||||
import com.mhd.wms.domain.materialInventory.repository.mapper.MaterialInventoryMapper;
|
||||
import com.mhd.wms.domain.materialInventory.repository.po.MaterialInventoryPO;
|
||||
import com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO;
|
||||
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.mapper.OutMaterialDetailMapper;
|
||||
@@ -52,6 +56,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
private IOutMaterialDetailSerialNumberService outMaterialDetailSerialNumberService;
|
||||
@Autowired
|
||||
private IdGenerator idGenerator;
|
||||
@Autowired
|
||||
private MaterialInventoryMapper materialInventoryMapper;
|
||||
|
||||
/**
|
||||
* 查询物料明细列表
|
||||
@@ -145,6 +151,7 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
outMaterialDetail.setCreateBy(loginUser.getUserid());
|
||||
outMaterialDetail.setCreateByName(loginUser.getUsername());
|
||||
outMaterialDetail.setCreateTime(new Date());
|
||||
outMaterialDetail.setQuantity(outMaterialDetail.getOutboundQuantity());
|
||||
outMaterialDetailList.add(outMaterialDetail);
|
||||
}
|
||||
return saveBatch(outMaterialDetailList);
|
||||
@@ -271,6 +278,32 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
stockOutOrderPO.setAllocationQuantity(totalAllocationQuantity);
|
||||
//保存物料明细信息
|
||||
saveOrUpdateBatch(outMaterialDetailList);
|
||||
|
||||
synchronized (this) {
|
||||
for (OutMaterialDetail outMaterialDetail : outMaterialDetailList) {
|
||||
Long materialBaseInfoId = outMaterialDetail.getMaterialBaseInfoId();
|
||||
BigDecimal allocationQuantity = outMaterialDetail.getAllocationQuantity();
|
||||
MaterialInventoryDO materialInventoryDO = new MaterialInventoryDO();
|
||||
materialInventoryDO.setMaterialBaseInfoId(materialBaseInfoId);
|
||||
MaterialInventoryPO materialInventoryPO = materialInventoryMapper.selectOneByWhere(materialInventoryDO);
|
||||
if (materialInventoryPO != null) {
|
||||
//更新库存数量
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
//冻结数量
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
//分配后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(allocationQuantity);
|
||||
//分配后冻结数量
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.add(allocationQuantity);
|
||||
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
MaterialInventory materialInventory = new MaterialInventory();
|
||||
BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
return stockOutOrderPO;
|
||||
}
|
||||
|
||||
@@ -517,4 +550,4 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
BeanUtils.copyProperties(outMaterialDetail, outMaterialDetailPO);
|
||||
return outMaterialDetailPO;
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
-9
@@ -329,62 +329,62 @@ public class OutMaterialDetailPO extends StockOutOrderBaseDO {
|
||||
*/
|
||||
@ApiModelProperty("申报数量")
|
||||
@Excel(name = "申报数量")
|
||||
private Double declareQuantity;
|
||||
private BigDecimal declareQuantity;
|
||||
|
||||
/**
|
||||
* 箱数
|
||||
*/
|
||||
@ApiModelProperty("箱数")
|
||||
@Excel(name = "箱数")
|
||||
private Double caseCount;
|
||||
private BigDecimal caseCount;
|
||||
|
||||
/**
|
||||
* 件数
|
||||
*/
|
||||
@ApiModelProperty("件数")
|
||||
@Excel(name = "件数")
|
||||
private Double pieceCount;
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
@ApiModelProperty("出库数量")
|
||||
@Excel(name = "出库数量")
|
||||
private Double outboundQuantity;
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
/**
|
||||
* 总净重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总净重(KG)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private Double totalNetWeight;
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
/**
|
||||
* 总毛重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总毛重(KG)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private Double totalGrossWeight;
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
/**
|
||||
* 总体积(CBM)
|
||||
*/
|
||||
@ApiModelProperty("总体积(CBM)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private Double totalVolume;
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
/**
|
||||
* 总面积(SQM)
|
||||
*/
|
||||
@ApiModelProperty("总面积(SQM)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private Double totalArea;
|
||||
private BigDecimal totalArea;
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
@ApiModelProperty("总价")
|
||||
@Excel(name = "总价")
|
||||
private Double totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
|
||||
+9
-9
@@ -337,62 +337,62 @@ public class OutMaterialDetailDO extends BaseVOEntity {
|
||||
*/
|
||||
@ApiModelProperty("申报数量")
|
||||
@Excel(name = "申报数量")
|
||||
private Double declareQuantity;
|
||||
private BigDecimal declareQuantity;
|
||||
|
||||
/**
|
||||
* 箱数
|
||||
*/
|
||||
@ApiModelProperty("箱数")
|
||||
@Excel(name = "箱数")
|
||||
private Double caseCount;
|
||||
private BigDecimal caseCount;
|
||||
|
||||
/**
|
||||
* 件数
|
||||
*/
|
||||
@ApiModelProperty("件数")
|
||||
@Excel(name = "件数")
|
||||
private Double pieceCount;
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
@ApiModelProperty("出库数量")
|
||||
@Excel(name = "出库数量")
|
||||
private Double outboundQuantity;
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
/**
|
||||
* 总净重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总净重(KG)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private Double totalNetWeight;
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
/**
|
||||
* 总毛重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总毛重(KG)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private Double totalGrossWeight;
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
/**
|
||||
* 总体积(CBM)
|
||||
*/
|
||||
@ApiModelProperty("总体积(CBM)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private Double totalVolume;
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
/**
|
||||
* 总面积(SQM)
|
||||
*/
|
||||
@ApiModelProperty("总面积(SQM)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private Double totalArea;
|
||||
private BigDecimal totalArea;
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
@ApiModelProperty("总价")
|
||||
@Excel(name = "总价")
|
||||
private Double totalAmount;
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
|
||||
+4
-1
@@ -28,7 +28,7 @@ public class ExcelParseService {
|
||||
* @param file 上传的Excel文件
|
||||
* @return 解析后的出仓委托单对象
|
||||
*/
|
||||
public StockOutOrderDO parseOutboundOrderExcel(MultipartFile file) throws IOException {
|
||||
public StockOutOrderDO parseOutboundOrderExcel(MultipartFile file, String warehouseName,String warehouseCode,Long warehouseId) throws IOException {
|
||||
|
||||
HeaderListener headerListener = new HeaderListener();
|
||||
|
||||
@@ -64,6 +64,9 @@ public class ExcelParseService {
|
||||
|
||||
StockOutOrderDO stockOutOrder = headerListener.getStockOutOrder();
|
||||
stockOutOrder.setMaterialDetailList(itemListener.getItemList());
|
||||
stockOutOrder.setWarehouseName(warehouseName);
|
||||
stockOutOrder.setWarehouseCode(warehouseCode);
|
||||
stockOutOrder.setWarehouseId(warehouseId);
|
||||
stockOutOrderApplicationService.insert(stockOutOrder);
|
||||
return stockOutOrder;
|
||||
}
|
||||
|
||||
+3
-1
@@ -9,6 +9,7 @@ import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mhd.common.core.domain.po.SysDictDataVo;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
import com.mhd.wms.domain.stockOutOrder.entity.StockOutOrder;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.todo.StockOutOrderDO;
|
||||
import lombok.Getter;
|
||||
@@ -34,6 +35,8 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
|
||||
private final DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private UserServiceFeign userServiceFeign;
|
||||
|
||||
@Override
|
||||
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
|
||||
@@ -54,7 +57,6 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
|
||||
case 5: // 第6行:承运方、tel、柜号、司机签名
|
||||
stockOutOrder.setCarrier(getStringValue(rowData[2]));
|
||||
stockOutOrder.setTel(getStringValue(rowData[5]));
|
||||
stockOutOrder.setContainerNoName(getStringValue(rowData[12]));
|
||||
if (ObjectUtil.isNotNull(getStringValue(rowData[12]))) {
|
||||
stockOutOrder.setContainerNoName(getStringValue(rowData[12]));
|
||||
AjaxResult transportMode = systemServiceFeign.selectListByDictType("cabinetNo");
|
||||
|
||||
+30
-11
@@ -2,8 +2,13 @@ package com.mhd.wms.domain.stockOutOrder.repository.listener;
|
||||
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||
import lombok.Getter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -17,6 +22,9 @@ import java.util.Collections;
|
||||
public class ItemListener extends AnalysisEventListener<Map<Integer, Object>> {
|
||||
private final List<OutMaterialDetailDO> itemList = new ArrayList<>();
|
||||
|
||||
@Autowired
|
||||
private MaterialBaseInfoMapper materialBaseInfoMapper;
|
||||
|
||||
@Override
|
||||
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
|
||||
// 将Map<Integer, Object>转换为Map<Integer, String>
|
||||
@@ -27,9 +35,11 @@ public class ItemListener extends AnalysisEventListener<Map<Integer, Object>> {
|
||||
|
||||
// 提取序号(第一列),过滤空行和标题行
|
||||
String serialNoStr = getStringValue(rowData[0]);
|
||||
String materialNo = getStringValue(rowData[1]);
|
||||
String commodityName = getStringValue(rowData[1]);
|
||||
String specificationModel = getStringValue(rowData[2]);
|
||||
if (materialNo.isEmpty() && specificationModel.isEmpty()) {
|
||||
String skuCode = getStringValue(rowData[4]);
|
||||
|
||||
if (commodityName.isEmpty() && specificationModel.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (serialNoStr.isEmpty() || "序号".equals(serialNoStr) || !isSequenceNumber(serialNoStr)) {
|
||||
@@ -38,6 +48,15 @@ public class ItemListener extends AnalysisEventListener<Map<Integer, Object>> {
|
||||
|
||||
OutMaterialDetailDO item = new OutMaterialDetailDO();
|
||||
|
||||
List<MaterialBaseInfo> materialBaseInfos = materialBaseInfoMapper.selectList(new LambdaQueryWrapper<MaterialBaseInfo>().eq(MaterialBaseInfo::getSkuCode, skuCode).eq(MaterialBaseInfo::getMaterialName, commodityName));
|
||||
|
||||
if (!materialBaseInfos.isEmpty()) {
|
||||
if (materialBaseInfos.size() > 1) {
|
||||
//return;
|
||||
}
|
||||
MaterialBaseInfo materialBaseInfo = materialBaseInfos.get(0);
|
||||
item.setMaterialBaseInfoId(materialBaseInfo.getMaterialBaseInfoId());
|
||||
}
|
||||
// 填充商品明细数据
|
||||
//商品名称 料号 规格型号/ITEM 商品SKU码 Invoice No. 申报数量 申报单位 升 箱数 件数 尺寸 仓库数量 "总净重
|
||||
//(KG)" 总毛重 (KG) "总体积
|
||||
@@ -47,24 +66,24 @@ public class ItemListener extends AnalysisEventListener<Map<Integer, Object>> {
|
||||
item.setSpecificationModel(getStringValue(rowData[3]));
|
||||
item.setSkucode(getStringValue(rowData[4]));
|
||||
item.setInvoiceNo(getStringValue(rowData[5]));
|
||||
item.setDeclareQuantity(parseBigDecimal(rowData[6]).doubleValue());
|
||||
item.setDeclareQuantity(parseBigDecimal(rowData[6]));
|
||||
item.setDeclareUnit(getStringValue(rowData[7]));
|
||||
item.setLiter(getStringValue(rowData[8]));
|
||||
item.setCaseCount(parseBigDecimal(rowData[9]).doubleValue());
|
||||
item.setPieceCount(parseBigDecimal(rowData[10]).doubleValue());
|
||||
item.setCaseCount(parseBigDecimal(rowData[9]));
|
||||
item.setPieceCount(parseBigDecimal(rowData[10]));
|
||||
item.setSize(getStringValue(rowData[11]));
|
||||
//仓库数量 出库数量?
|
||||
item.setOutboundQuantity(parseBigDecimal(rowData[12]).doubleValue());
|
||||
item.setTotalNetWeight(parseBigDecimal(rowData[13]).doubleValue());
|
||||
item.setTotalGrossWeight(parseBigDecimal(rowData[14]).doubleValue());
|
||||
item.setTotalVolume(parseBigDecimal(rowData[15]).doubleValue());
|
||||
item.setTotalArea(parseBigDecimal(rowData[16]).doubleValue());
|
||||
item.setOutboundQuantity(parseBigDecimal(rowData[12]));
|
||||
item.setTotalNetWeight(parseBigDecimal(rowData[13]));
|
||||
item.setTotalGrossWeight(parseBigDecimal(rowData[14]));
|
||||
item.setTotalVolume(parseBigDecimal(rowData[15]));
|
||||
item.setTotalArea(parseBigDecimal(rowData[16]));
|
||||
item.setBatchRefNo(getStringValue(rowData[17]));
|
||||
item.setSheetRefNo(getStringValue(rowData[18]));
|
||||
item.setCountryOfOrigin(getStringValue(rowData[19]));
|
||||
|
||||
item.setCasePalletNo(getStringValue(rowData[20]));
|
||||
item.setTotalAmount(parseBigDecimal(rowData[21]).doubleValue());
|
||||
item.setTotalAmount(parseBigDecimal(rowData[21]));
|
||||
item.setCurrency(getStringValue(rowData[22]));
|
||||
item.setRemark(getStringValue(rowData[23]));
|
||||
|
||||
|
||||
+4
-4
@@ -128,8 +128,8 @@ public class StockOutOrderDomainService {
|
||||
//统计种类
|
||||
//stockOutOrderDO.setMaterialQuantity(stockOutOrderDO.getMaterialDetailList().size());
|
||||
//统计总数量
|
||||
//BigDecimal quantity = stockOutOrderDO.getMaterialDetailList().stream().map(OutMaterialDetailDO::getQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
//stockOutOrderDO.setQuantity(quantity);
|
||||
BigDecimal quantity = stockOutOrderDO.getMaterialDetailList().stream().map(OutMaterialDetailDO::getOutboundQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
stockOutOrderDO.setQuantity(quantity);
|
||||
//统计总重量
|
||||
// BigDecimal weightLimit = stockOutOrderDO.getMaterialDetailList().stream().map(OutMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
// stockOutOrderDO.setWeightLimit(weightLimit);
|
||||
@@ -953,7 +953,7 @@ public class StockOutOrderDomainService {
|
||||
outMaterialDetailDO.setPackName(materialBaseInfoPO.getPackName());
|
||||
|
||||
//获取包装详情
|
||||
AjaxResult packDetailResult = systemServiceFeign.getInfoByPackIdAndUnitCode(materialBaseInfoPO.getPackId(), "EA");
|
||||
/*AjaxResult packDetailResult = systemServiceFeign.getInfoByPackIdAndUnitCode(materialBaseInfoPO.getPackId(), "EA");
|
||||
if(!"200".equals(String.valueOf(packDetailResult.get("code")))){
|
||||
throw new ServiceException("获取物料单位EA信息失败");
|
||||
}
|
||||
@@ -971,7 +971,7 @@ public class StockOutOrderDomainService {
|
||||
throw new ServiceException("物料仓库控制信息不存在");
|
||||
}
|
||||
outMaterialDetailDO.setMaterialWarehouseControlId(materialWarehouseControlPO.getMaterialWarehouseControlId());
|
||||
outMaterialDetailDO.setSerialNumberManage(materialWarehouseControlPO.getSerialNumberManage());
|
||||
outMaterialDetailDO.setSerialNumberManage(materialWarehouseControlPO.getSerialNumberManage());*/
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
+163
-1
@@ -236,4 +236,166 @@ public class OutMaterialDetailDTO extends BaseVOEntity {
|
||||
@ApiModelProperty("取消分配数量")
|
||||
@Excel(name = "取消分配数量")
|
||||
private BigDecimal cancelAllocationQuantity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ApiModelProperty("商品名称")
|
||||
@Excel(name = "商品名称")
|
||||
private String commodityName;
|
||||
/**
|
||||
* 商品编码
|
||||
*/
|
||||
@ApiModelProperty("商品编码")
|
||||
@Excel(name = "商品编码")
|
||||
private String commodityNo;
|
||||
/**
|
||||
* 料号
|
||||
*/
|
||||
@ApiModelProperty("料号")
|
||||
@Excel(name = "料号")
|
||||
private String materialNo;
|
||||
/**
|
||||
* 规格型号
|
||||
*/
|
||||
@ApiModelProperty("规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String specificationModel;
|
||||
/**
|
||||
* 商品SKU码
|
||||
*/
|
||||
@ApiModelProperty("商品SKU码")
|
||||
@Excel(name = "商品SKU码")
|
||||
private String skucode;
|
||||
/**
|
||||
* Invoice No
|
||||
*/
|
||||
@ApiModelProperty("Invoice No")
|
||||
@Excel(name = "Invoice No")
|
||||
private String invoiceNo;
|
||||
/**
|
||||
* 升
|
||||
*/
|
||||
@ApiModelProperty("升")
|
||||
@Excel(name = "升")
|
||||
private String liter;
|
||||
|
||||
/**
|
||||
* 尺寸
|
||||
*/
|
||||
@ApiModelProperty("尺寸")
|
||||
@Excel(name = "尺寸")
|
||||
private String size;
|
||||
|
||||
/**
|
||||
* 申报单位
|
||||
*/
|
||||
@ApiModelProperty("申报单位")
|
||||
@Excel(name = "申报单位")
|
||||
private String declareUnit;
|
||||
|
||||
/**
|
||||
* Batch Ref NO’s
|
||||
*/
|
||||
@ApiModelProperty("Batch Ref NO’s")
|
||||
@Excel(name = "Batch Ref NO’s")
|
||||
private String batchRefNo;
|
||||
|
||||
/**
|
||||
* Sheet Ref NO’s
|
||||
*/
|
||||
@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 casePalletNo;
|
||||
|
||||
/**
|
||||
* 币制
|
||||
*/
|
||||
@ApiModelProperty("币制")
|
||||
@Excel(name = "币制")
|
||||
private String currency;
|
||||
|
||||
/**
|
||||
* 申报数量
|
||||
*/
|
||||
@ApiModelProperty("申报数量")
|
||||
@Excel(name = "申报数量")
|
||||
private BigDecimal declareQuantity;
|
||||
|
||||
/**
|
||||
* 箱数
|
||||
*/
|
||||
@ApiModelProperty("箱数")
|
||||
@Excel(name = "箱数")
|
||||
private BigDecimal caseCount;
|
||||
|
||||
/**
|
||||
* 件数
|
||||
*/
|
||||
@ApiModelProperty("件数")
|
||||
@Excel(name = "件数")
|
||||
private BigDecimal pieceCount;
|
||||
|
||||
/**
|
||||
* 出库数量
|
||||
*/
|
||||
@ApiModelProperty("出库数量")
|
||||
@Excel(name = "出库数量")
|
||||
private BigDecimal outboundQuantity;
|
||||
|
||||
/**
|
||||
* 总净重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总净重(KG)")
|
||||
@Excel(name = "总净重(KG)")
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
/**
|
||||
* 总毛重(KG)
|
||||
*/
|
||||
@ApiModelProperty("总毛重(KG)")
|
||||
@Excel(name = "总毛重(KG)")
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
/**
|
||||
* 总体积(CBM)
|
||||
*/
|
||||
@ApiModelProperty("总体积(CBM)")
|
||||
@Excel(name = "总体积(CBM)")
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
/**
|
||||
* 总面积(SQM)
|
||||
*/
|
||||
@ApiModelProperty("总面积(SQM)")
|
||||
@Excel(name = "总面积(SQM)")
|
||||
private BigDecimal totalArea;
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
@ApiModelProperty("总价")
|
||||
@Excel(name = "总价")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
}
|
||||
+16
-3
@@ -5,19 +5,24 @@ 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.wms.application.service.stockOutOrder.StockOutOrderApplicationService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.todo.OutMaterialDetailDO;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.listener.ExcelParseService;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.po.StockOutOrderPO;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.todo.StockOutOrderDO;
|
||||
import com.mhd.wms.interfaces.assember.stockOutOrder.StockOutOrderAssembler;
|
||||
import com.mhd.wms.interfaces.dto.outMaterialDetail.OutMaterialDetailDTO;
|
||||
import com.mhd.wms.interfaces.dto.stockOutOrder.StockOutOrderDTO;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpRequest;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
@@ -58,7 +63,11 @@ public class StockOutOrderApi extends BaseController {
|
||||
*/
|
||||
@PostMapping("/import")
|
||||
public AjaxResult parseOutboundOrder(
|
||||
@RequestParam("file") MultipartFile file) {
|
||||
@RequestParam("file") MultipartFile file,
|
||||
HttpServletRequest request,
|
||||
@RequestParam("warehouseId") Long warehouseId,
|
||||
@RequestParam("warehouseCode") String warehouseCode,
|
||||
@RequestParam("warehouseName") String warehouseName) {
|
||||
|
||||
// 验证文件
|
||||
if (file.isEmpty()) {
|
||||
@@ -73,7 +82,7 @@ public class StockOutOrderApi extends BaseController {
|
||||
|
||||
try {
|
||||
// 解析Excel并返回结果
|
||||
StockOutOrderDO result = excelParseService.parseOutboundOrderExcel(file);
|
||||
StockOutOrderDO result = excelParseService.parseOutboundOrderExcel(file, warehouseName, warehouseCode, warehouseId);
|
||||
return AjaxResult.success(result);
|
||||
} catch (IOException e) {
|
||||
return error("解析失败");
|
||||
@@ -132,7 +141,11 @@ public class StockOutOrderApi extends BaseController {
|
||||
@ApiOperation("手动分配")
|
||||
@PostMapping("/manualAssign")
|
||||
public AjaxResult manualAssign(@RequestBody StockOutOrderDTO stockOutOrderDTO) {
|
||||
StockOutOrderDO stockOutOrderDO = JSONUtil.toBean(JSONUtil.toJsonStr(stockOutOrderDTO), StockOutOrderDO.class);
|
||||
//StockOutOrderDO stockOutOrderDO = JSONUtil.toBean(JSONUtil.toJsonStr(stockOutOrderDTO), StockOutOrderDO.class);
|
||||
StockOutOrderDO stockOutOrderDO = new StockOutOrderDO();
|
||||
BeanUtils.copyProperties(stockOutOrderDTO, stockOutOrderDO);
|
||||
List<OutMaterialDetailDO> materialDetailList = cn.hutool.core.bean.BeanUtil.copyToList(stockOutOrderDTO.getMaterialDetailList(), OutMaterialDetailDO.class);
|
||||
stockOutOrderDO.setMaterialDetailList(materialDetailList);
|
||||
return toAjax(stockOutOrderApplicationService.manualAssign(stockOutOrderDO));
|
||||
}
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.storage_location_code,
|
||||
a.storage_location_name
|
||||
FROM
|
||||
`material_inventory` a
|
||||
material_inventory a
|
||||
LEFT JOIN material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
WHERE
|
||||
a.del_flag = 1 AND b.shipper_id = #{shipperId} AND a.top_organization_id = #{topOrganizationId}
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.max_temperature,
|
||||
a.pack_detail_id,
|
||||
a.unit_code,
|
||||
a.`name`,
|
||||
a.name,
|
||||
a.top_organization_id,
|
||||
b.shipper_id
|
||||
FROM
|
||||
|
||||
Reference in New Issue
Block a user