出库流程操作库存;出库单导入调整;
This commit is contained in:
+34
-24
@@ -128,30 +128,40 @@ public class HandoverTaskOrderDomainService {
|
||||
* @param handoverTaskOrderDO
|
||||
* @return Boolean
|
||||
*/
|
||||
public Boolean completeHandover(HandoverTaskOrderDO handoverTaskOrderDO){
|
||||
//交接完成节点修改库存
|
||||
String orderNumber = handoverTaskOrderDO.getOrderNumber();
|
||||
List<OutMaterialDetail> outMaterialDetailList = outMaterialDetailMapper.selectList(new QueryWrapper<OutMaterialDetail>().lambda()
|
||||
.eq(OutMaterialDetail::getOutOrderNumber, orderNumber));
|
||||
for (OutMaterialDetail outMaterialDetail : outMaterialDetailList) {
|
||||
Long materialInventoryId = outMaterialDetail.getMaterialInventoryId();
|
||||
BigDecimal checkQuantity = outMaterialDetail.getCheckQuantity();
|
||||
MaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//更新库存数量
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
//冻结数量
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
//分配后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(checkQuantity);
|
||||
//分配后冻结数量
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(checkQuantity);
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
MaterialInventory materialInventory = new MaterialInventory();
|
||||
BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
public Boolean completeHandover(HandoverTaskOrderDO handoverTaskOrderDO) {
|
||||
List<Long> handoverTaskOrderIds = handoverTaskOrderDO.getHandoverTaskOrderIds();
|
||||
if (handoverTaskOrderIds == null || handoverTaskOrderIds.size() == 0) {
|
||||
return false;
|
||||
}
|
||||
for (Long handoverTaskOrderId : handoverTaskOrderIds) {
|
||||
HandoverTaskOrder handoverTaskOrder = handoverTaskOrderService.getById(handoverTaskOrderId);
|
||||
if (handoverTaskOrder == null) {
|
||||
return false;
|
||||
}
|
||||
//交接完成节点修改库存
|
||||
String orderNumber = handoverTaskOrder.getOrderNumber();
|
||||
List<OutMaterialDetail> outMaterialDetailList = outMaterialDetailMapper.selectList(new QueryWrapper<OutMaterialDetail>().lambda()
|
||||
.eq(OutMaterialDetail::getOutOrderNumber, orderNumber));
|
||||
for (OutMaterialDetail outMaterialDetail : outMaterialDetailList) {
|
||||
Long materialInventoryId = outMaterialDetail.getMaterialInventoryId();
|
||||
BigDecimal checkQuantity = outMaterialDetail.getCheckQuantity();
|
||||
MaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//更新库存数量
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
//冻结数量
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
//分配后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(checkQuantity);
|
||||
//分配后冻结数量
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(checkQuantity);
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
MaterialInventory materialInventory = new MaterialInventory();
|
||||
BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
|
||||
+2
-2
@@ -276,7 +276,7 @@ public class PickingOrderDomainService {
|
||||
pickingOrderDO.setPickingOrderNumber(pickingOrderPODb.getPickingOrderNumber());
|
||||
PickingOrderPO pickingOrderPO = pickingMaterialDetailService.batchPickingUpdate(pickingOrderDO);
|
||||
//修改库存
|
||||
updateMaterialInventory(pickingOrderDO);
|
||||
//updateMaterialInventory(pickingOrderDO);
|
||||
//设置拣货单拣货需要更新的数据数据
|
||||
updatePickingOrder(pickingOrderPO, pickingOrderPODb);
|
||||
//更新出库单状态
|
||||
@@ -749,4 +749,4 @@ public class PickingOrderDomainService {
|
||||
}
|
||||
deliveTaskService.batchInsert(deliveTaskDOList);
|
||||
}
|
||||
}
|
||||
}
|
||||
+203
-5
@@ -1,18 +1,38 @@
|
||||
package com.mhd.wms.domain.stockOutOrder.repository.listener;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelReader;
|
||||
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
|
||||
import com.alibaba.excel.read.metadata.ReadSheet;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.mhd.common.core.domain.po.SysDictDataVo;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.application.service.stockOutOrder.StockOutOrderApplicationService;
|
||||
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 com.mhd.wms.domain.stockOutOrder.entity.StockOutOrder;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.facade.IStockOutOrderService;
|
||||
import com.mhd.wms.domain.stockOutOrder.repository.todo.StockOutOrderDO;
|
||||
import com.mhd.wms.domain.stockOutOrder.service.StockOutOrderDomainService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@@ -23,12 +43,20 @@ public class ExcelParseService {
|
||||
|
||||
@Autowired
|
||||
private StockOutOrderApplicationService stockOutOrderApplicationService;
|
||||
@Resource
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private MaterialBaseInfoMapper materialBaseInfoMapper;
|
||||
@Autowired
|
||||
private StockOutOrderDomainService stockOutOrderDomainService;
|
||||
@Resource
|
||||
private UserServiceFeign userServiceFeign;
|
||||
/**
|
||||
* 解析出仓委托单Excel
|
||||
* @param file 上传的Excel文件
|
||||
* @return 解析后的出仓委托单对象
|
||||
*/
|
||||
public StockOutOrderDO parseOutboundOrderExcel(MultipartFile file, String warehouseName,String warehouseCode,Long warehouseId) throws IOException {
|
||||
public StringBuilder parseOutboundOrderExcel(MultipartFile file, String warehouseName,String warehouseCode,Long warehouseId) throws IOException {
|
||||
|
||||
HeaderListener headerListener = new HeaderListener();
|
||||
|
||||
@@ -61,13 +89,183 @@ public class ExcelParseService {
|
||||
itemReader.read(itemSheet);
|
||||
|
||||
itemReader.finish();
|
||||
|
||||
List<OutMaterialDetailDO> itemList = itemListener.getItemList();
|
||||
StockOutOrderDO stockOutOrder = headerListener.getStockOutOrder();
|
||||
stockOutOrder.setMaterialDetailList(itemListener.getItemList());
|
||||
initList(itemList,warehouseId,warehouseCode,warehouseName);
|
||||
stockOutOrder.setMaterialDetailList(itemList);
|
||||
stockOutOrder.setWarehouseName(warehouseName);
|
||||
stockOutOrder.setWarehouseCode(warehouseCode);
|
||||
stockOutOrder.setWarehouseId(warehouseId);
|
||||
stockOutOrderApplicationService.insert(stockOutOrder);
|
||||
return stockOutOrder;
|
||||
initDict(stockOutOrder);
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
stockOutOrder.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
stockOutOrder.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
stockOutOrder.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
}
|
||||
initParam(stockOutOrder);
|
||||
//校验必填字段
|
||||
StringBuilder errorMsg = check(stockOutOrder);
|
||||
if (errorMsg.length() > 0) {
|
||||
return errorMsg;
|
||||
} else {
|
||||
insert(stockOutOrder);
|
||||
return new StringBuilder();
|
||||
}
|
||||
}
|
||||
|
||||
private void initParam(StockOutOrderDO stockOutOrderDO) {
|
||||
//设置货主信息
|
||||
shipperParam(stockOutOrderDO);
|
||||
//设置客户信息
|
||||
customerParam(stockOutOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增出库单
|
||||
*/
|
||||
public Boolean insert(StockOutOrderDO stockOutOrderDO) {
|
||||
return stockOutOrderDomainService.insert(stockOutOrderDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 封装货主信息
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/9 20:43
|
||||
* @param stockOutOrderDO
|
||||
*/
|
||||
private void shipperParam(StockOutOrderDO stockOutOrderDO){
|
||||
String customerName = stockOutOrderDO.getCustomerName();
|
||||
if (StringUtils.isEmpty(customerName)) return;
|
||||
if (!customerName.matches("\\d+")) {
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfoByName(customerName);
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取客户信息失败");
|
||||
}
|
||||
UserPo userPo = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
stockOutOrderDO.setShipperId(userPo.getUserId());
|
||||
stockOutOrderDO.setShipperCode(userPo.getUserMemberCode());
|
||||
stockOutOrderDO.setShipperName(userPo.getUserName());
|
||||
} else {
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(Long.valueOf(customerName));
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取货主信息失败");
|
||||
}
|
||||
UserPo userPo = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
stockOutOrderDO.setShipperId(userPo.getUserId());
|
||||
stockOutOrderDO.setShipperCode(userPo.getUserMemberCode());
|
||||
stockOutOrderDO.setShipperName(userPo.getUserName());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 封装客户信息
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/9 20:43
|
||||
* @param stockOutOrderDO
|
||||
*/
|
||||
private void customerParam(StockOutOrderDO stockOutOrderDO){
|
||||
String customerName = stockOutOrderDO.getCustomerName();
|
||||
if (StringUtils.isEmpty(customerName)) return;
|
||||
if (!customerName.matches("\\d+")) {
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfoByName(customerName);
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取客户信息失败");
|
||||
}
|
||||
UserPo userPo = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
stockOutOrderDO.setCustomerId(userPo.getUserId());
|
||||
stockOutOrderDO.setCustomerCode(userPo.getUserMemberCode());
|
||||
stockOutOrderDO.setCustomerName(userPo.getUserName());
|
||||
} else {
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfo(Long.valueOf(customerName));
|
||||
if(!"200".equals(String.valueOf(ajaxResult.get("code")))){
|
||||
throw new ServiceException("获取客户信息失败");
|
||||
}
|
||||
UserPo userPo = JSON.parseObject(com.alibaba.fastjson2.JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
stockOutOrderDO.setCustomerId(userPo.getUserId());
|
||||
stockOutOrderDO.setCustomerCode(userPo.getUserMemberCode());
|
||||
stockOutOrderDO.setCustomerName(userPo.getUserName());
|
||||
}
|
||||
}
|
||||
|
||||
private StringBuilder check(StockOutOrderDO stockOutOrder) {
|
||||
StringBuilder errorMsg = new StringBuilder();
|
||||
if (stockOutOrder.getMaterialDetailList() == null || stockOutOrder.getMaterialDetailList().isEmpty()) errorMsg.append("物料明细列表不能为空或匹配不上物料信息; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getTo())) errorMsg.append("To不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getEntrustNo())) errorMsg.append("委托单号不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getCarrier())) errorMsg.append("承运商不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getTransportModeCode())) errorMsg.append("运输方式不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getSupervisionModeCode())) errorMsg.append("监督方式不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getContainerNo())) errorMsg.append("柜号不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getDepartureArrivalCountry())) errorMsg.append("出发/到达国家不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getManufacturer())) errorMsg.append("制造商不能为空; ");
|
||||
if (ObjectUtil.isEmpty(stockOutOrder.getOutboundDate())) errorMsg.append("出仓日期不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getContactPerson())) errorMsg.append("联系人不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getTel())) errorMsg.append("Tel不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getFax())) errorMsg.append("Fax不能为空; ");
|
||||
if (ObjectUtil.isEmpty(stockOutOrder.getShipperId())) errorMsg.append("客户名称不能为空或匹配不上客户信息; ");
|
||||
//if (StringUtils.isEmpty(stockOutOrder.getNeedDeclareFlag())) errorMsg.append("是否需要申报不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getDeclareCustoms())) errorMsg.append("申报地关区不能为空; ");
|
||||
if (StringUtils.isEmpty(stockOutOrder.getEntryExitCustoms())) errorMsg.append("进出境关别不能为空; ");
|
||||
//if (StringUtils.isEmpty(stockOutOrder.getNeedTransportFlag())) errorMsg.append("是否需要运输不能为空; ");
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
private void initList(List<OutMaterialDetailDO> outMaterialDetailDOList, Long warehouseId, String warehouseCode, String warehouseName) {
|
||||
for (OutMaterialDetailDO outMaterialDetailDO : outMaterialDetailDOList) {
|
||||
outMaterialDetailDO.setWarehouseId(warehouseId);
|
||||
outMaterialDetailDO.setWarehouseCode(warehouseCode);
|
||||
outMaterialDetailDO.setWarehouseName(warehouseName);
|
||||
String materialNo = outMaterialDetailDO.getMaterialNo();
|
||||
List<MaterialBaseInfo> materialBaseInfos = materialBaseInfoMapper.selectList(new LambdaQueryWrapper<MaterialBaseInfo>().eq(MaterialBaseInfo::getMaterialCode, materialNo));
|
||||
if (!materialBaseInfos.isEmpty()) {
|
||||
if (materialBaseInfos.size() > 1) {
|
||||
return;
|
||||
}
|
||||
MaterialBaseInfo materialBaseInfo = materialBaseInfos.get(0);
|
||||
outMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfo.getMaterialBaseInfoId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initDict(StockOutOrderDO stockOutOrder) {
|
||||
if (ObjectUtil.isNotNull(stockOutOrder.getContainerNoName())) {
|
||||
AjaxResult transportMode = systemServiceFeign.selectListByDictType("cabinetNo");
|
||||
if (ObjectUtil.isNotNull(transportMode) && "200".equals(String.valueOf(transportMode.get("code")))) {
|
||||
List<SysDictDataVo> transportModeList = JSON.parseArray(JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
|
||||
for (SysDictDataVo sysDictDataVo : transportModeList) {
|
||||
if (stockOutOrder.getContainerNoName().equals(sysDictDataVo.getDictLabel())) {
|
||||
stockOutOrder.setContainerNo(sysDictDataVo.getDictValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotNull(stockOutOrder.getTransportModeName())) {
|
||||
AjaxResult transportMode = systemServiceFeign.selectListByDictType("transportMode");
|
||||
if (ObjectUtil.isNotNull(transportMode) && "200".equals(String.valueOf(transportMode.get("code")))) {
|
||||
List<SysDictDataVo> transportModeList = JSON.parseArray(com.alibaba.fastjson2.JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
|
||||
for (SysDictDataVo sysDictDataVo : transportModeList) {
|
||||
if (stockOutOrder.getTransportModeName().equals(sysDictDataVo.getDictLabel())) {
|
||||
stockOutOrder.setTransportModeCode(sysDictDataVo.getDictValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotNull(stockOutOrder.getSupervisionModeName())) {
|
||||
AjaxResult transportMode = systemServiceFeign.selectListByDictType("controlType");
|
||||
if (ObjectUtil.isNotNull(transportMode) && "200".equals(String.valueOf(transportMode.get("code")))) {
|
||||
List<SysDictDataVo> transportModeList = JSON.parseArray(com.alibaba.fastjson2.JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
|
||||
for (SysDictDataVo sysDictDataVo : transportModeList) {
|
||||
if (stockOutOrder.getSupervisionModeName().equals(sysDictDataVo.getDictLabel())) {
|
||||
stockOutOrder.setSupervisionModeCode(sysDictDataVo.getDictValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
-53
@@ -1,20 +1,14 @@
|
||||
package com.mhd.wms.domain.stockOutOrder.repository.listener;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.context.AnalysisContext;
|
||||
import com.alibaba.excel.event.AnalysisEventListener;
|
||||
import com.alibaba.excel.metadata.data.ReadCellData;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -23,7 +17,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 解析表头信息的监听器(处理前11行)
|
||||
@@ -33,10 +26,6 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
|
||||
private final StockOutOrderDO stockOutOrder = new StockOutOrderDO();
|
||||
private int rowNum = 0;
|
||||
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) {
|
||||
@@ -57,19 +46,7 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
|
||||
case 5: // 第6行:承运方、tel、柜号、司机签名
|
||||
stockOutOrder.setCarrier(getStringValue(rowData[2]));
|
||||
stockOutOrder.setTel(getStringValue(rowData[5]));
|
||||
if (ObjectUtil.isNotNull(getStringValue(rowData[12]))) {
|
||||
stockOutOrder.setContainerNoName(getStringValue(rowData[12]));
|
||||
AjaxResult transportMode = systemServiceFeign.selectListByDictType("cabinetNo");
|
||||
if (ObjectUtil.isNotNull(transportMode) && transportMode.get("code").equals("200")) {
|
||||
List<SysDictDataVo> transportModeList = JSON.parseArray(JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
|
||||
for (SysDictDataVo sysDictDataVo : transportModeList) {
|
||||
if (getStringValue(rowData[12]).equals(sysDictDataVo.getDictLabel())) {
|
||||
stockOutOrder.setContainerNo(sysDictDataVo.getDictValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stockOutOrder.setContainerNoName(getStringValue(rowData[12]));
|
||||
stockOutOrder.setDriverSign(getStringValue(rowData[16]));
|
||||
break;
|
||||
case 6: // 第7行:出仓日期、fax、运输方式、申报地关区
|
||||
@@ -79,19 +56,7 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
|
||||
stockOutOrder.setOutboundDate(date);
|
||||
}
|
||||
stockOutOrder.setFax(getStringValue(rowData[5]));
|
||||
if (ObjectUtil.isNotNull(getStringValue(rowData[12]))) {
|
||||
stockOutOrder.setTransportModeName(getStringValue(rowData[12]));
|
||||
AjaxResult transportMode = systemServiceFeign.selectListByDictType("transportMode");
|
||||
if (ObjectUtil.isNotNull(transportMode) && transportMode.get("code").equals("200")) {
|
||||
List<SysDictDataVo> transportModeList = JSON.parseArray(JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
|
||||
for (SysDictDataVo sysDictDataVo : transportModeList) {
|
||||
if (getStringValue(rowData[12]).equals(sysDictDataVo.getDictLabel())) {
|
||||
stockOutOrder.setTransportModeCode(sysDictDataVo.getDictValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stockOutOrder.setTransportModeName(getStringValue(rowData[12]));
|
||||
stockOutOrder.setDeclareCustoms(getStringValue(rowData[16]));
|
||||
break;
|
||||
case 7: // 第8行:生产商、客户名称、报关姓名及联系方式、完成时间
|
||||
@@ -105,21 +70,10 @@ public class HeaderListener extends AnalysisEventListener<Map<Integer, Object>>
|
||||
}
|
||||
break;
|
||||
case 8: // 第9行:监管方式、送货地址、海关是否查验货物、进出境关别
|
||||
if (ObjectUtil.isNotNull(getStringValue(rowData[2]))) {
|
||||
stockOutOrder.setSupervisionModeName(getStringValue(rowData[2]));
|
||||
AjaxResult transportMode = systemServiceFeign.selectListByDictType("controlType");
|
||||
if (ObjectUtil.isNotNull(transportMode) && transportMode.get("code").equals("200")) {
|
||||
List<SysDictDataVo> transportModeList = JSON.parseArray(JSONObject.toJSONString(transportMode.get("data")), SysDictDataVo.class);
|
||||
for (SysDictDataVo sysDictDataVo : transportModeList) {
|
||||
if (getStringValue(rowData[2]).equals(sysDictDataVo.getDictLabel())) {
|
||||
stockOutOrder.setSupervisionModeCode(sysDictDataVo.getDictValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stockOutOrder.setSupervisionModeName(getStringValue(rowData[2]));
|
||||
stockOutOrder.setDeliveryAddr(getStringValue(rowData[5]));
|
||||
stockOutOrder.setCustomsInspectionFlag(getStringValue(rowData[12]));
|
||||
String stringValue = getStringValue(rowData[12]);
|
||||
stockOutOrder.setCustomsInspectionFlag(stringValue);
|
||||
stockOutOrder.setEntryExitCustoms(getStringValue(rowData[16]));
|
||||
break;
|
||||
case 9: // 第10行:下单日期、起运国
|
||||
|
||||
-11
@@ -22,8 +22,6 @@ 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) {
|
||||
@@ -37,7 +35,6 @@ public class ItemListener extends AnalysisEventListener<Map<Integer, Object>> {
|
||||
String serialNoStr = getStringValue(rowData[0]);
|
||||
String commodityName = getStringValue(rowData[1]);
|
||||
String specificationModel = getStringValue(rowData[2]);
|
||||
String skuCode = getStringValue(rowData[4]);
|
||||
|
||||
if (commodityName.isEmpty() && specificationModel.isEmpty()) {
|
||||
return;
|
||||
@@ -48,15 +45,7 @@ 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) "总体积
|
||||
|
||||
Reference in New Issue
Block a user