看板3数据sql调整

冲孔杠入库均衡分配
定位及一键出库测试调整
main
Comair 1 year ago
parent e40fbd2baf
commit e62cdaccc9
  1. 2
      shkj-wms/src/main/java/com/shkj/wms/mapper/BaseLocationMapper.java
  2. 14
      shkj-wms/src/main/java/com/shkj/wms/plc/PlcEventTask.java
  3. 2
      shkj-wms/src/main/java/com/shkj/wms/plc/PlcInit.java
  4. 97
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  5. 8
      shkj-wms/src/main/java/com/shkj/wms/service/IBaseLocationService.java
  6. 2
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseBarcodesInServiceImpl.java
  7. 132
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BaseLocationServiceImpl.java
  8. 1
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java
  9. 7
      shkj-wms/src/main/java/com/shkj/wms/service/impl/IBusinEnptyContainerServiceImpl.java
  10. 1
      shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java
  11. 2
      shkj-wms/src/main/java/com/shkj/wms/service/impl/StackServiceImpl.java
  12. 4
      shkj-wms/src/main/java/com/shkj/wms/third/rcs/RCSUtil.java
  13. 31
      shkj-wms/src/main/resources/mapper/wms/BaseLocationMapper.xml
  14. 40
      shkj-wms/src/main/resources/mapper/wms/SysStockMapper.xml

@ -104,5 +104,7 @@ public interface BaseLocationMapper extends BaseMapper<BaseLocation> {
List<BaseLocationDetailVo> queryTargetLocation(BaseLocationUrgentBo bo);
List<BaseLocationVo> queryBaseLocationListByGoodsPunching(BaseLocationQueryListBo bo);
}

@ -136,7 +136,7 @@ public class PlcEventTask {
private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(8);
// @Scheduled(fixedRate = 200)
@Scheduled(fixedRate = 200)
public void init() {
//查询需要连接的PLC,初始化连接对象
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1"));
@ -219,7 +219,7 @@ public class PlcEventTask {
}
}
// @Scheduled(fixedRate = 200)
@Scheduled(fixedRate = 200)
public void init1() {
//查询需要连接的PLC,初始化连接对象
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1"));
@ -237,7 +237,7 @@ public class PlcEventTask {
}
}
// @Scheduled(fixedRate = 200)
@Scheduled(fixedRate = 200)
public void init2() {
//查询需要连接的PLC,初始化连接对象
List<WcsPlcConnectVo> plcList = iWcsPlcConnectService.selectWcsPlcConnectList(new WcsPlcConnect().setIsActive("1"));
@ -255,7 +255,7 @@ public class PlcEventTask {
}
}
// @Scheduled(fixedDelay = 6000)
@Scheduled(fixedDelay = 6000)
public void writePlcheartbeat() {
//根据连接的plcId获取属性
PlcOperate plcOperate = plcInit.getPlcOperate_41();
@ -523,7 +523,7 @@ public class PlcEventTask {
tunnel = businDataTaskServiceById.getTunnel();
String taskType = businDataTaskServiceById.getTaskType();
if (!taskType.equals("4") && !taskType.equals("5") && !taskType.equals("15")
&& !taskType.equals("16") && !taskType.equals("21") && !taskType.equals("9")) {
&& !taskType.equals("16") && !taskType.equals("21") && !taskType.equals("9") && !taskType.equals("25")) {
//增加库存
Result<Boolean> booleanResult = iPutInOutStorageService.productDeposit(taskId);
//处理成功 返回状态,写入状态位为0
@ -849,7 +849,9 @@ public class PlcEventTask {
agvTaskType = Integer.valueOf(abnormalWaitPintDeviceVo.getIsDown());
} else if (businDataTask.getTaskType().equals(TaskTypeEnum.relocation_out.getValue())) {
// TODO 跨巷道移库AGV的模板尚未提供
} else {
} else if(businDataTask.getTaskType().equals(TaskTypeEnum.named_loc.getValue())){
}else {
agvPoints.add(businDataTask.getTaskPath());
snPointMap.put("3", businDataTask.getTaskPath());

@ -42,7 +42,7 @@ public class PlcInit {
RedisTemplate redisTemplate;
private ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);
//@PostConstruct
@PostConstruct
public void init(){
log.info("初始化连接对象");
executorService.scheduleWithFixedDelay(

@ -943,15 +943,24 @@ public class ScheduledTasks {
basePointDeviceVo = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo).get(1);
}
} else {
NUMBER = false;
//先入待冲孔区
Long punchingArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area));
List<BaseLocationVo> baseLocationVos = baseLocationMapper.getLocationByAreaId(punchingArea);
if (baseLocationVos.size() > 0) {
locationVo = baseLocationVos.get(0);
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId());
AssingEmptyLocBo assingEmptyLocBo = new AssingEmptyLocBo();
assingEmptyLocBo.setBusinDataTaskGoodsVos(businDataTaskGoodsVos);
//冲孔杠分配货位
Result<BaseLocationVo> locationVoResult = iBaseLocationService.assignEmptyLocatioPunching(assingEmptyLocBo);
if (ObjectUtils.isNotEmpty(locationVoResult) && locationVoResult.getCode() == HttpStatus.SUCCESS.getCode()) {
//如果是P01则设置randome为P02
redisTemplate.opsForValue().set("randome", "P02");
locationVo = locationVoResult.getData();
}
if(locationVo == null){
log.info("冲孔杠分配货位为空");
return;
}
businDataTaskVo.setToColumn(locationVo.getLocationColumn());
businDataTaskVo.setToLayer(locationVo.getLayer());
@ -960,16 +969,6 @@ public class ScheduledTasks {
String tunnel = locationVo.getTunnel();
businDataTaskVo.setTunnel(tunnel);
businDataTaskVo.setLocationId(locationVo.getId());
// Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(locationVo.getId());
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.selectBusinTaskGoodsByTaskCode(businDataTaskVo.getId());
BusinTaskExeBo exeBo = new BusinTaskExeBo();
exeBo.setTaskCode(taskId);
exeBo.setBusinDataTaskGoodsVo(businDataTaskGoodsVos);
exeBo.setContainerId(containerId);
exeBo.setBaseLocationVo(locationVo);
exeBo.setTransNo("1");
exeBo.setTransQual("1");
// iPutInOutStorageService.exeTaskPutinStorage(exeBo);
//获取巷道对应的立库输送线接驳口
pointQueryBo.setTunnel(tunnel);
pointQueryBo.setDirection("0");
@ -978,16 +977,10 @@ public class ScheduledTasks {
basePointDeviceVo = basePointDeviceVos.get(0);
basePointDeviceVo.setPlcId(Long.valueOf(isysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id)));
}
//获取巷道对应的堆垛机信息
pointQueryBo.setDevType("1");
BaseDevicePlcVo baseDevicePlcVo = baseLocationPlcMapper.selectBaseDevicePlc(pointQueryBo);
stkPlcId = baseDevicePlcVo.getPlcId();
// points.add(basePointDeviceVo.getHandshakePoint());
// points.add(basePointDeviceVo.getHandshakePoint());
// snPointMap.put("3",basePointDeviceVo.getHandshakePoint());
// snPointMap.put("4",basePointDeviceVo.getHandshakePoint());
}
}
String toPointNo = "";
@ -998,16 +991,12 @@ public class ScheduledTasks {
points.add(toPointNo);
snPointMap.put("3", toPointNo);
// String toPointNo="KW18";
// points.add(toPointNo);
// snPointMap.put("3",toPointNo);
int agvTaskType;
if (toPointNo.equals("KW12")) {
agvTaskType = 24;
} else {
agvTaskType = 27;
}
// TODO 中科 测试 需要删除
businDataTaskVo.setPoints(JsonUtil.toJSONString(snPointMap));
businDataTaskVo.setIsDown(String.valueOf(agvTaskType));
//呼叫AGV
@ -1058,12 +1047,6 @@ public class ScheduledTasks {
//获取要出库的物料信息
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId());
//拿到按比例分配的库区
// randome = allocationTasksUtils.randomeout();
//测试时使用
randome = "P01";
//TODO 测试注释 要到开
// if (randome.equals("P02")) {
if (businDataTaskVo.getDistinction().equals("2")) {
int number = businDataTaskGoodsVos.size();
List<String> goodsno = businDataTaskGoodsVos.stream().map(e -> e.getGoodsNo()).collect(Collectors.toList());
@ -1086,7 +1069,6 @@ public class ScheduledTasks {
businDataTaskVo.setTaskType(TaskTypeEnum.thirteen_out.getValue());
businDataTaskVo.setTaskPath(frompoint);
}
}
//TODO 测试注释 要到开
@ -1142,9 +1124,6 @@ public class ScheduledTasks {
baseBarcodesOutServiceOne.setOutStatus("2");
iBaseBarcodesOutService.updateById(baseBarcodesOutServiceOne);
}
//添加巷道任务数和总任务数
//tunnelTaskUtil.addOutboundTaskNum(businDataTask.getTunnel());
} else {
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) {
businDataTask.setExceptionMsg("下发堆垛机失败");
@ -1161,38 +1140,6 @@ public class ScheduledTasks {
businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存");
businDataTaskVo.setTaskStatus("-3");
}
// if (ObjectUtils.isNotEmpty(list)) {
//
//
// }else {
// businDataTaskVo.setExceptionMsg("当前开放的货位已无当前库存");
// businDataTaskVo.setTaskStatus("-3");
// }
// else {
// //如果立库没有库存那么查看平库是否有库存
// int numberT = businDataTaskGoodsVos.size();
// List<String> goodsnoT = businDataTaskGoodsVos.stream().map(e -> e.getGoodsNo()).collect(Collectors.toList());
// //根据GoodsNo查看立库是否有库存
// List<SysStockDetail> listT = iSysStockDetailService.list(new LambdaQueryWrapper<SysStockDetail>()
// .in(SysStockDetail::getGoodsNo, goodsno)
// .eq(SysStockDetail::getQty, "1")
// .isNull(SysStockDetail::getOutQty)
// .isNull(SysStockDetail::getLocationId));
// if (ObjectUtils.isEmpty(listT)) {
// businDataTaskVo.setTaskStatus("-3");
// }else {
// String frompoint = null;
// String tepairGroup = sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.P_out01);
// pointQueryBo.setGroupNo(tepairGroup);
// BasePointDeviceVo pointDeviceout = basePointDeviceMapper.selectBasePointByGroupno(pointQueryBo);
// frompoint = pointDeviceout.getPointNo();
// businDataTaskVo.setTaskStatus(TaskStatusEnum.four_out.getValue());
// businDataTaskVo.setTaskType(TaskTypeEnum.thirteen_out.getValue());
// businDataTaskVo.setTaskPath(TaskTypeEnum.thirteen_out.getValue());
// businDataTaskVo.setTaskPath(frompoint);
// }
// }
}
}
@ -1606,6 +1553,17 @@ public class ScheduledTasks {
}
else if("25".equals(taskType)){
BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId());
//获取货位对应的巷道及巷道对应的设备信息
pointQueryBo.setTunnel(businDataTask.getTunnel());
pointQueryBo.setDirection("0");
BasePointDeviceVo basePointDeviceVo = baseLocationPlcMapper.selectBasePointByGroupno(pointQueryBo).get(0);
Long plcId=0L;
if (basePointDeviceVo != null) {
plcId = Long.valueOf(isysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.LK_plc_id));
}
businDataTask.setDpsNoOne(plcId);
businDataTaskVo.setDpsNoOne(plcId);
Result<Boolean> taskResult = outTask(businDataTask);
businDataTaskVo.setUpdateTime(DateUtils.getNowDate());
if (Result.isOk(taskResult)) {
@ -2080,11 +2038,6 @@ public class ScheduledTasks {
Long stkPlcId = null;
String agvno = null;
//获取派生
// TODO 由于逻辑区域换成与车型相匹配,不是与派生匹配,所以注释掉
// Long dervieId = getLocationByDervie(vehicheModel, color);
String randome = "P01";
if (businDataTaskVo.getWarehouseType().equals("1")) {
randome = "P01";

@ -157,6 +157,14 @@ public interface IBaseLocationService extends IService<BaseLocation> {
Result<BaseLocationVo> assignEmptyLocationAll(AssingEmptyLocBo assingEmptyLocBo);
/**
* 冲孔杠分配货位
* @param assingEmptyLocBo
* @return
*/
Result<BaseLocationVo> assignEmptyLocatioPunching(AssingEmptyLocBo assingEmptyLocBo);
/**
* 检查货位是否有对应双深位
*

@ -129,7 +129,7 @@ public class BaseBarcodesInServiceImpl extends ServiceImpl<BaseBarcodesInMapper,
@Transactional(rollbackFor = Exception.class)
@Override
public ThirdYklResult thirdSyncBaseBarcodesIn(List<BaseBarcodesInThirdSyncBo> bos) {
log.info("上游同步入库条码:"+JsonUtil.toJSONString(bos));
// log.info("上游同步入库条码:"+JsonUtil.toJSONString(bos));
BaseBarcodesIn baseBarcodesIn = null;
BaseGoodsData baseGoodsData = null;

@ -1014,6 +1014,138 @@ public class BaseLocationServiceImpl extends ServiceImpl<BaseLocationMapper, Bas
}
@Override
public synchronized Result<BaseLocationVo> assignEmptyLocatioPunching(AssingEmptyLocBo assingEmptyLocBo){
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = assingEmptyLocBo.getBusinDataTaskGoodsVos();
String goodsNo ="";
String vehicheModel = assingEmptyLocBo.getVehicheModel();
String batch = assingEmptyLocBo.getBatch();
BaseLocationVo locationVo = null;
if (businDataTaskGoodsVos != null && businDataTaskGoodsVos.size() > 0) {
BusinDataTaskGoodsVo businDataTaskGoodsVo = businDataTaskGoodsVos.get(0);
String taskCode = businDataTaskGoodsVo.getTaskCode();
goodsNo=businDataTaskGoodsVo.getGoodsNo();
log.info("冲孔入库分配货位任务号:" + taskCode + " 保险杠编号:" + goodsNo);
}else
{
return Result.err().msg("无保险杠信息");
}
BaseLocationQueryListBo bo = new BaseLocationQueryListBo();
bo.setGoodsNo(goodsNo);
bo.setLocationStatus("0");
log.info("冲孔保险杠分配货位查询条件:" + JsonUtil.toJSONString(bo));
List<BaseLocationVo> baseLocationVos = this.baseMapper.queryBaseLocationListByGoodsPunching(bo);
if (baseLocationVos.size() == 0) {
//查看缓冲区是否还有货位
Long bufferArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.buffer_area));
List<BaseLocationVo> baseLocationVoList = baseLocationMapper.getLocationByAreaId(bufferArea);
log.info("冲孔保险杠保险杠缓冲区分配到的货位信息:" + baseLocationVoList.size());
if (baseLocationVoList.size() < 0) {
log.info("冲孔保险杠车型及缓冲区都未查询到空货位");
return Result.err().msg("冲孔保险杠保险杠分配货位暂无空货位可用");
}
//baseLocationVos.addAll(baseLocationVoList);
baseLocationVos = baseLocationVoList;
}
//拿到所有可用货位,根据巷道号对双深位的巷道进行处理
//空货位所在巷道列表,同时过滤掉已有入库任务的巷道
List<String> tunnelList = baseLocationVos.stream().map(e -> e.getTunnel()).distinct().collect(Collectors.toList());
log.info("保险杠分配货位查询到的货位对应的巷道信息:" + JsonUtil.toJSONString(tunnelList));
//从存在空货位的巷道里选择较优的巷道进行入库
//首选选择任务数为空或者任务数最少的巷道
//任务数相同时选取空货位最多的巷道;24.06.27改为查询库存数量最少并且空货位数最多的
List<String> tunnelResult = new ArrayList<>();
Integer minTaskNum = 0;
Integer maxEmptyLocationNum = 0;
Integer minGoodsQty = 0;
for (int i = 0; i < tunnelList.size(); i++) {
String tunnel = tunnelList.get(i);
Integer taskNum = tunnelTaskUtil.getTotalTaskNum(tunnel, 0);
List<BaseLocationVo> currTunnelLocationVos = baseLocationVos.stream().filter(e -> tunnel.equals(e.getTunnel())).collect(Collectors.toList());
int curEmptyNum = currTunnelLocationVos.size();
BaseLocationVo baseLocationVo = currTunnelLocationVos.get(0);
int currGoodsQty = 0;
if (baseLocationVo.getGoodQty() != null) {
currGoodsQty = baseLocationVo.getGoodQty();
}
//获取巷道内库存数量最少并且空货位数最多的
log.info("保险杠分配之前----当前巷道:" + tunnel + " 目前任务数:" + taskNum + " 当前空货位数量:" + curEmptyNum + " 最小任务数:" + minTaskNum + " 最大空货位数:" + maxEmptyLocationNum + " 当前库存量:" + currGoodsQty);
if (minTaskNum == 0 && taskNum.equals(minTaskNum)) {
if (i != 0) {
if (currGoodsQty < minGoodsQty) {
minGoodsQty = currGoodsQty;
if (curEmptyNum > maxEmptyLocationNum) {
tunnelResult.clear();
tunnelResult.add(tunnel);
maxEmptyLocationNum = curEmptyNum;
}
}
} else {
minGoodsQty = currGoodsQty;
minTaskNum = taskNum;
tunnelResult.add(tunnel);
maxEmptyLocationNum = curEmptyNum;
}
} else if (minTaskNum == 0) {
if (i == 0) {
minGoodsQty = currGoodsQty;
minTaskNum = taskNum;
tunnelResult.add(tunnel);
maxEmptyLocationNum = curEmptyNum;
}
} else if (minTaskNum != 0 && taskNum.equals(minTaskNum)) {
if (currGoodsQty < minGoodsQty) {
minGoodsQty = currGoodsQty;
if (curEmptyNum > maxEmptyLocationNum) {
tunnelResult.clear();
tunnelResult.add(tunnel);
maxEmptyLocationNum = curEmptyNum;
}
}
} else if (minTaskNum != 0 && taskNum < minTaskNum) {
minGoodsQty = currGoodsQty;
minTaskNum = taskNum;
tunnelResult.clear();
tunnelResult.add(tunnel);
maxEmptyLocationNum = curEmptyNum;
}
log.info("保险杠分配之后----当前巷道:" + tunnel + " 目前任务数:" + taskNum + " 当前空货位数量:" + curEmptyNum + " 最小任务数:" + minTaskNum + " 最大空货位数:" + maxEmptyLocationNum + " 当前库存量:" + currGoodsQty);
}
log.info("巷道的任务数量:" + JsonUtil.toJSONString(tunnelResult));
//从选取的巷道中选择库位
if (tunnelResult.size() > 0) {
String tunnel = tunnelResult.get(0);
List<BaseLocationVo> resultLocationList = baseLocationVos.stream().filter(e -> tunnel.equals(e.getTunnel())).collect(Collectors.toList());
locationVo = resultLocationList.get(0);
log.info("分配的货位:" + JsonUtil.toJSONString(locationVo));
//巷道中货位数大于1时,进行分配
if (resultLocationList.size() > 0) {
//判断是否是双深位相关
BaseLocationVo assginLocation = assginLocation(resultLocationList, batch, vehicheModel, businDataTaskGoodsVos);
if (assginLocation != null) {
locationVo = assginLocation;
log.info("最终分配的货位信息:" + assginLocation);
}
}
}
if (locationVo != null) {
//确定分配该库位,并将库位状态改为已分配
this.changeLocationStatus(locationVo.getId(), "4");
locationVo.setLocationStatus("4");
return Result.ok().data(locationVo);
} else {
// TODO 是否需要逻辑处理,如果在选取的巷道中货位为空时!!
return Result.err();
}
}
/**
* 保险杠分配货位检查是否是双深位
* @param locationList

@ -564,6 +564,7 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
baseLocationVo.setLocationStatus("4");
BaseLocation baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);
iBaseLocationService.updateById(baseLocation);
//生成作业任务
int index = 0;
List<BusinDataTaskGoods> taskGoodsList = new ArrayList<>();

@ -358,7 +358,10 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
List<BaseLocationVo> baseLocationVoList = baseLocationMapper.getEmptyContainerFromLocation(emptyconArea);
List<String> tunnelList = baseLocationVoList.stream().map(e -> e.getTunnel()).distinct().collect(Collectors.toList());
if (tunnelList.size() == 0){
log.error("无空托可以出库");
return;
}
//从存在存放空治具货位的巷道里选择较优的巷道进行入库
//首选选择任务数为空或者任务数最少的巷道
//任务数相同时选取存放空治具货位最多的巷道
@ -483,7 +486,7 @@ public class IBusinEnptyContainerServiceImpl extends ServiceImpl<BaseContainerMa
SysStockDetail sysStockDetail = iSysStockDetailService.getOne(new LambdaQueryWrapper<SysStockDetail>()
.eq(SysStockDetail::getLocationId, baseLocationVo.getId())
.eq(SysStockDetail::getQty, "1")
.isNull(SysStockDetail::getOutQty));
.isNull(SysStockDetail::getOutQty).last("limit 1"));
Long containerId=null;
if (ObjectUtils.isNotEmpty(sysStockDetail)) {
containerId = sysStockDetail.getContainerCode();

@ -1068,6 +1068,7 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe
@Override
public Result<Boolean> productDeposit(Long taskId) {
log.info("增加库存任务号:"+taskId);
BusinBillHeadBodyQueryBo bodyQueryBo =new BusinBillHeadBodyQueryBo();
bodyQueryBo.setTaskId(taskId);

@ -349,7 +349,7 @@ public class StackServiceImpl implements IStackService {
}
businDataTask.setTaskPath(toLocation);
iBusinDataTaskService.insertBusinDataTask(businDataTask);
iBusinDataTaskService.save(businDataTask);
Long taskId =businDataTask.getId();
List<BusinDataTaskGoods> goodsList = new ArrayList<>();

@ -1496,6 +1496,8 @@ public class RCSUtil {
if (StringUtils.isNotEmpty(agvData)) {
RcsThirdResult thirdResult = JSONObject.parseObject(agvData, RcsThirdResult.class);
List<BusinAgvRealRedisInfo> redisList = new ArrayList<>();
if (JsonUtil.toJSONString(thirdResult.getData()).equals("{}")){
List<BusinAgvRealInfo> list = JSONArray.parseArray(thirdResult.getData().toString(), BusinAgvRealInfo.class);
BusinAgvRealRedisInfo businAgvRealRedisInfo = null;
for (BusinAgvRealInfo businAgvRealInfo : list) {
@ -1515,7 +1517,7 @@ public class RCSUtil {
businAgvRealRedisInfo.setErrors(businAgvRealInfo.getErrors());
redisList.add(businAgvRealRedisInfo);
}
}
redisTemplate.opsForValue().set(RedisConstant.redisAgvRealInfo, redisList);
} else {
log.info("AGV实时数据为空");

@ -535,6 +535,37 @@
ORDER BY bl.route asc,is_deep desc
</select>
<select id="queryBaseLocationListByGoodsPunching" resultMap="BaseLocationResult"
parameterType="com.shkj.wms.bo.BaseLocationQueryListBo">
SELECT
bl.* ,
IFNULL( goodsStock.stock, 0 ) AS goodQty,
IFNULL( goodsStock.tunnel,bl.tunnel )as stokctunnel,
ba.storage_id as storage_id,
bs.storage_name as bs_storage_name,
bs.storage_code as storage_code
FROM
base_location bl
LEFT JOIN base_area ba ON bl.area_id = ba.id
LEFT JOIN base_storage bs ON ba.storage_id = bs.id
LEFT JOIN (SELECT count( goods_no ) stock, tunnel FROM sys_stock_detail stock WHERE stock.goods_no = #{goodsNo} GROUP BY tunnel)
goodsStock on bl.tunnel=goodsStock.tunnel
WHERE
bl.is_del = '0'
AND ba.is_del = '0'
AND bs.is_del = '0' and bl.area_id =17
<if test="locationStatus != null">
and ifnull(bl.location_status,'0') = #{locationStatus}
</if>
<if test="tunnel != null">
and bl.tunnel = #{tunnel}
</if>
ORDER BY bl.route asc,is_deep desc
</select>
<select id="getBaseLocationForMap" resultType="com.shkj.wms.vo.BaseLocationVo"
parameterType="com.shkj.wms.bo.BaseLocationQueryPageBo">
select

@ -131,32 +131,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="vehicheColorLocationList" resultType="com.shkj.wms.vo.SysStockVCLocationVo" parameterType="com.shkj.wms.bo.SysReportStockQueryBo">
select count(distinct loc.id) as locQty, alltmp.stockqty as stockqty,
g.color, IFNULL(g.vehiche_model,'empty') as vehiche_model
,loc.tunnel ,sum(distinct emptyLoc.emptyLocQty) emptyLocQty,sum(distinct emptyCon.emptyConQty) as emptyConQty
from base_location loc
left join(
select count(distinct location_id) stockqty,goods_no,locGoods.tunnel from
sys_stock_detail stock
INNER JOIN base_location locGoods on locGoods.id =stock.location_id
where stock.qty>0
group by goods_no,locGoods.tunnel
) alltmp on alltmp.tunnel=loc.tunnel
left join base_goods_data g on g.goods_no=alltmp.goods_no
left join (
select count(id) emptyLocQty,tunnel from base_location
where location_status=0 and is_del=0
group by tunnel
) emptyLoc on emptyLoc.tunnel =loc.tunnel
left join (
select count(id) emptyConQty,tunnel from base_location
where location_status=2 and is_del=0
group by tunnel
)emptyCon on emptyCon.tunnel =loc.tunnel
SELECT
g.color,
IFNULL(g.vehiche_model,'empty') as vehiche_model,
loc.tunnel,
sum(case when location_status = 0 then 1 else 0 end ) as emptyLocQty,
sum(case when location_status = 2 then 1 else 0 end ) as emptyConQty,
count(distinct stock.location_id) stockqty
FROM
base_location loc
left join sys_stock_detail stock on loc.id =stock.location_id and IFNULL(goods_no,'')!=''
LEFT JOIN base_goods_data g ON g.goods_no = stock.goods_no
where loc.is_del=0
GROUP BY g.color, g.vehiche_model,loc.tunnel,emptyCon.tunnel
GROUP BY
g.color,
g.vehiche_model,
loc.tunnel
</select>
<select id="getVehicheStockList" resultType="com.shkj.wms.vo.SysStockVehicheVo">

Loading…
Cancel
Save