工作站添加线边库设置

This commit is contained in:
JinLu.Yin 2022-09-10 10:50:31 +08:00
parent 7764262dc7
commit 8daa2ea520
4 changed files with 50 additions and 0 deletions

View File

@ -165,4 +165,12 @@ public class UserConstants
public static final String QC_TYPE_IQC = "IQC"; //来料检验单 public static final String QC_TYPE_IQC = "IQC"; //来料检验单
public static final String QC_TYPE_IPQC = "IPQC"; //过程检验单 public static final String QC_TYPE_IPQC = "IPQC"; //过程检验单
public static final String QC_TYPE_OQC = "OQC"; //出货检验 public static final String QC_TYPE_OQC = "OQC"; //出货检验
/**
* 默认线边库对应的仓库库区库位编码
*/
public static final String VIRTUAL_WH ="XBK_VIRTUAL";
public static final String VIRTUAL_WS ="XBKKQ_VIRTUAL";
public static final String VIRTUAL_WA ="XBKKW_VIRTUAL";
} }

View File

@ -147,10 +147,13 @@ public class MdWorkstationController extends BaseController
location = wmStorageLocationService.selectWmStorageLocationByLocationCode(UserConstants.VIRTUAL_WS); location = wmStorageLocationService.selectWmStorageLocationByLocationCode(UserConstants.VIRTUAL_WS);
area = wmStorageAreaService.selectWmStorageAreaByAreaCode(UserConstants.VIRTUAL_WA); area = wmStorageAreaService.selectWmStorageAreaByAreaCode(UserConstants.VIRTUAL_WA);
} }
mdWorkstation.setWarehouseId(warehouse.getWarehouseId());
mdWorkstation.setWarehouseCode(warehouse.getWarehouseCode()); mdWorkstation.setWarehouseCode(warehouse.getWarehouseCode());
mdWorkstation.setWorkstationName(warehouse.getWarehouseName()); mdWorkstation.setWorkstationName(warehouse.getWarehouseName());
mdWorkstation.setLocationId(location.getLocationId());
mdWorkstation.setLocationCode(location.getLocationCode()); mdWorkstation.setLocationCode(location.getLocationCode());
mdWorkstation.setLocationName(location.getLocationName()); mdWorkstation.setLocationName(location.getLocationName());
mdWorkstation.setAreaId(area.getAreaId());
mdWorkstation.setAreaCode(area.getAreaCode()); mdWorkstation.setAreaCode(area.getAreaCode());
mdWorkstation.setAreaName(area.getAreaName()); mdWorkstation.setAreaName(area.getAreaName());

View File

@ -81,4 +81,10 @@ public interface IWmWarehouseService
* @return 结果 * @return 结果
*/ */
public int deleteWmWarehouseByWarehouseId(Long warehouseId); public int deleteWmWarehouseByWarehouseId(Long warehouseId);
/**
* 初始化虚拟的线边库
* @return
*/
public WmWarehouse initVirtualWarehouse();
} }

View File

@ -5,7 +5,12 @@ import java.util.List;
import com.ktg.common.constant.UserConstants; import com.ktg.common.constant.UserConstants;
import com.ktg.common.utils.DateUtils; import com.ktg.common.utils.DateUtils;
import com.ktg.common.utils.StringUtils; import com.ktg.common.utils.StringUtils;
import com.ktg.mes.wm.domain.WmStorageArea;
import com.ktg.mes.wm.domain.WmStorageLocation;
import com.ktg.mes.wm.mapper.WmStorageAreaMapper;
import com.ktg.mes.wm.mapper.WmStorageLocationMapper;
import org.apache.catalina.User; import org.apache.catalina.User;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ktg.mes.wm.mapper.WmWarehouseMapper; import com.ktg.mes.wm.mapper.WmWarehouseMapper;
@ -24,6 +29,12 @@ public class WmWarehouseServiceImpl implements IWmWarehouseService
@Autowired @Autowired
private WmWarehouseMapper wmWarehouseMapper; private WmWarehouseMapper wmWarehouseMapper;
@Autowired
private WmStorageLocationMapper wmStorageLocationMapper;
@Autowired
private WmStorageAreaMapper wmStorageAreaMapper;
/** /**
* 查询仓库设置 * 查询仓库设置
* *
@ -127,4 +138,26 @@ public class WmWarehouseServiceImpl implements IWmWarehouseService
{ {
return wmWarehouseMapper.deleteWmWarehouseByWarehouseId(warehouseId); return wmWarehouseMapper.deleteWmWarehouseByWarehouseId(warehouseId);
} }
@Override
public WmWarehouse initVirtualWarehouse() {
WmWarehouse warehouse = new WmWarehouse();
warehouse.setWarehouseCode(UserConstants.VIRTUAL_WH);
warehouse.setWarehouseName("线边库-虚拟");
wmWarehouseMapper.insertWmWarehouse(warehouse);
WmStorageLocation location = new WmStorageLocation();
location.setWarehouseId(warehouse.getWarehouseId());
location.setLocationCode(UserConstants.VIRTUAL_WS);
location.setLocationName("线边库库区-虚拟");
location.setAreaFlag(UserConstants.YES);
wmStorageLocationMapper.insertWmStorageLocation(location);
WmStorageArea area = new WmStorageArea();
area.setLocationId(location.getLocationId());
area.setAreaCode(UserConstants.VIRTUAL_WA);
area.setAreaName("线边库库位-虚拟");
wmStorageAreaMapper.insertWmStorageArea(area);
return warehouse;
}
} }