add:木箱库
This commit is contained in:
13
lms/nladmin-system/.gitignore
vendored
Normal file
13
lms/nladmin-system/.gitignore
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
### IDEA ###
|
||||
*/*.log
|
||||
.idea/*
|
||||
*.iml
|
||||
*/target/*
|
||||
*/*.iml
|
||||
/.gradle/
|
||||
/target/*
|
||||
*/application-dev.yml
|
||||
nlsso-server/src/main/java/org/nl/common/constant/
|
||||
nlsso-server/src/main/java/org/nl/common/core/
|
||||
/C:*
|
||||
/D:*
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxStockUpPlanService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author Gengby
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/bstIvtBoxStockUpPlan")
|
||||
public class BstIvtBoxStockUpPlanController {
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.controller;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstacklayerService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dto.BstIvtBoxstackQuery;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author Gengby
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/api/bstIvtboxstacklayer")
|
||||
public class BstIvtBoxstacklayerController {
|
||||
|
||||
@Autowired
|
||||
private IBstIvtBoxstacklayerService boxstacklayerService;
|
||||
|
||||
@GetMapping("/getBoxLayer/{stackId}")
|
||||
@Log("根据堆叠位ID查询堆叠位层数详情")
|
||||
public ResponseEntity<Object> query(@PathVariable String stackId) {
|
||||
return new ResponseEntity<>(boxstacklayerService.getByStackId(stackId), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -29,8 +29,12 @@ public enum BoxStackEnum {
|
||||
AGV_SYSTEM_TYPE(MapOf.of("1楼诺宝任务", "1", "2楼1区域AGV系统", "2", "1楼叉车任务", "3")),
|
||||
//木箱库位启用状态
|
||||
IS_USED(MapOf.of("启用", "1", "未启用", "0")),
|
||||
//是否
|
||||
IS_OK(MapOf.of("是", "1", "否", "0")),
|
||||
//备货计划状态
|
||||
STOCK_UP_STATUS(MapOf.of("未开始", "1", "执行中", "2", "完成", "3")),
|
||||
//木箱库区域
|
||||
POINT_STATUS(MapOf.of("密集区", "1", "零散区", "2", "缓存区", "3"));
|
||||
POINT_STATUS(MapOf.of("密集区", "1", "零散区", "2", "缓存区", "3", "出库区", "4", "等待区", "5"));
|
||||
|
||||
|
||||
private Map<String, String> code;
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxStockUpPlan;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author Gengby
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
public interface IBstIvtBoxStockUpPlanService extends IService<BstIvtBoxStockUpPlan> {
|
||||
|
||||
|
||||
// List<BstIvtBoxStockUpPlan> getByStackId(String stackId);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstacklayer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author Gengby
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
public interface IBstIvtBoxstacklayerService extends IService<BstIvtBoxstacklayer> {
|
||||
|
||||
|
||||
List<BstIvtBoxstacklayer> getByStackId(String stackId);
|
||||
}
|
||||
@@ -15,31 +15,46 @@ import java.io.Serializable;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("bst_ivt_boxstacklayer")
|
||||
public class BstIvtBoxstacklayer implements Serializable {
|
||||
@TableName("bst_ivt_boxstockup_plan")
|
||||
public class BstIvtBoxStockUpPlan implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "stack_layer_id", type = IdType.NONE)
|
||||
private String stack_layer_id;
|
||||
@TableId(value = "stockup_plan_id", type = IdType.NONE)
|
||||
private String stockup_plan_id;
|
||||
|
||||
/**
|
||||
* 堆叠位id
|
||||
* 木箱规格
|
||||
*/
|
||||
private String stack_id;
|
||||
private String box_spec;
|
||||
|
||||
/**
|
||||
* 木箱编码
|
||||
* 木箱规格名称
|
||||
*/
|
||||
private String box_code;
|
||||
private String box_spec_name;
|
||||
|
||||
/**
|
||||
* 层号
|
||||
* 备货数量
|
||||
*/
|
||||
private Integer layer_index;
|
||||
private Integer stock_up_num;
|
||||
|
||||
/**
|
||||
* 备货日期 yyyy-MM-dd
|
||||
*/
|
||||
private String stock_plan_time;
|
||||
|
||||
/**
|
||||
* 是否已经进行备货 1、未开始 2、执行中 3、完成
|
||||
*/
|
||||
private String stock_plan_status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
@@ -56,6 +56,11 @@ public class BstIvtBoxstack implements Serializable {
|
||||
*/
|
||||
private String box_spec;
|
||||
|
||||
/**
|
||||
* 木箱编码,多个以,分割
|
||||
*/
|
||||
private String box_no;
|
||||
|
||||
/**
|
||||
* 排
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxStockUpPlan;
|
||||
|
||||
|
||||
public interface BstIvtBoxStockUpPlanMapper extends BaseMapper<BstIvtBoxStockUpPlan> {
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper.BstIvtBoxstacklayerMapper">
|
||||
<mapper namespace="org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper.BstIvtBoxStockUpPlanMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -1,10 +0,0 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstacklayer;
|
||||
|
||||
|
||||
public interface BstIvtBoxstacklayerMapper extends BaseMapper<BstIvtBoxstacklayer> {
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.service.dto;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -11,23 +10,34 @@ import java.io.Serializable;
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
@Data
|
||||
public class BstIvtBoxstacklayerDto implements Serializable {
|
||||
private String stack_layer_id;
|
||||
public class BstIvtBoxStockUpPlanDto implements Serializable {
|
||||
|
||||
private String stockup_plan_id;
|
||||
|
||||
/**
|
||||
* 堆叠位id
|
||||
* 木箱规格
|
||||
*/
|
||||
private String stack_id;
|
||||
private String box_spec;
|
||||
|
||||
/**
|
||||
* 木箱编码
|
||||
* 木箱规格名称
|
||||
*/
|
||||
private String box_code;
|
||||
private String box_spec_name;
|
||||
|
||||
/**
|
||||
* 层号
|
||||
* 备货数量
|
||||
*/
|
||||
private Integer layer_index;
|
||||
private Integer stock_up_num;
|
||||
|
||||
/**
|
||||
* 备货日期 yyyy-MM-dd
|
||||
*/
|
||||
private String stock_plan_time;
|
||||
|
||||
/**
|
||||
* 是否已经进行备货 0否 1是
|
||||
*/
|
||||
private String stock_plan_status;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
@@ -8,5 +8,5 @@ import lombok.Data;
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
@Data
|
||||
public class BstIvtBoxstacklayerQuery {
|
||||
public class BstIvtBoxStockUpPlanQuery {
|
||||
}
|
||||
@@ -8,5 +8,5 @@ import lombok.Data;
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
@Data
|
||||
public class BstIvtBoxstacklayerVo {
|
||||
public class BstIvtBoxStockUpPlanVo {
|
||||
}
|
||||
@@ -42,6 +42,11 @@ public class BstIvtBoxstackDto implements Serializable {
|
||||
*/
|
||||
private String point_status;
|
||||
|
||||
/**
|
||||
* 木箱编号
|
||||
*/
|
||||
private String box_no;
|
||||
|
||||
/**
|
||||
* 木箱规格(物料编码)
|
||||
*/
|
||||
|
||||
@@ -18,6 +18,10 @@ public class BstIvtBoxstackQuery {
|
||||
* 区域
|
||||
*/
|
||||
private String point_status;
|
||||
/**
|
||||
* 木箱编码
|
||||
*/
|
||||
private String box_no;
|
||||
/**
|
||||
* 木箱规格
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxStockUpPlanService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxStockUpPlan;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper.BstIvtBoxStockUpPlanMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author Gengby
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BstIvtBoxStockUpPlanServiceImpl extends ServiceImpl<BstIvtBoxStockUpPlanMapper, BstIvtBoxStockUpPlan> implements IBstIvtBoxStockUpPlanService {
|
||||
|
||||
// @Override
|
||||
// public List<BstIvtBoxStockUpPlan> getByStackId(String stackId) {
|
||||
// return this.list(new LambdaQueryWrapper<BstIvtBoxStockUpPlan>().eq(BstIvtBoxStockUpPlan::getStack_id, stackId));
|
||||
// }
|
||||
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import com.github.pagehelper.PageHelper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstackService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstacklayerService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxStockUpPlanService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxStockUpPlan;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstacklayer;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper.BstIvtBoxstackMapper;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dto.BstIvtBoxstackDto;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dto.BstIvtBoxstackQuery;
|
||||
@@ -45,8 +45,6 @@ public class BstIvtBoxstackServiceImpl extends ServiceImpl<BstIvtBoxstackMapper,
|
||||
@Autowired
|
||||
private BstIvtBoxstackMapper boxstackMapper;
|
||||
@Autowired
|
||||
private IBstIvtBoxstacklayerService boxstacklayerService;
|
||||
@Autowired
|
||||
private IBstIvtBoxinfoService boxinfoService;
|
||||
|
||||
@Override
|
||||
@@ -61,17 +59,38 @@ public class BstIvtBoxstackServiceImpl extends ServiceImpl<BstIvtBoxstackMapper,
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(BstIvtBoxstackDto entity) {
|
||||
if (entity.getMax_layer_count() <= 0) {
|
||||
throw new RuntimeException("最大堆叠数必须大于0");
|
||||
if (entity.getMax_layer_count() < 0) {
|
||||
throw new RuntimeException("最大堆叠数必须大于等于0");
|
||||
}
|
||||
BstIvtBoxstack boxstack = new BstIvtBoxstack();
|
||||
|
||||
String box_no = entity.getBox_no();
|
||||
if (StringUtils.isBlank(box_no)) {
|
||||
boxstack.setCurrent_layer_count(0);
|
||||
if (StringUtils.isNotBlank(entity.getBox_spec())) {
|
||||
throw new BadRequestException("木箱码为空,木箱规格也必须为空");
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isBlank(entity.getBox_spec())) {
|
||||
throw new BadRequestException("木箱码不为空,木箱规格也不能为空");
|
||||
}
|
||||
String[] boxNos = box_no.split(",");
|
||||
for (int i = 0; i < boxNos.length; i++) {
|
||||
String boxNo = boxNos[i];
|
||||
BstIvtBoxinfo boxinfo = boxinfoService.getOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||
if (ObjectUtil.isNull(boxinfo)) {
|
||||
throw new BadRequestException("木箱码:" + boxNo + "在木箱信息表中不存在");
|
||||
}
|
||||
}
|
||||
boxstack.setCurrent_layer_count(boxNos.length);
|
||||
}
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentNickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
BstIvtBoxstack boxstack = new BstIvtBoxstack();
|
||||
boxstack.setStack_id(IdUtil.getStringId());
|
||||
boxstack.setStack_code(entity.getStack_code());
|
||||
boxstack.setStack_name(entity.getStack_name());
|
||||
boxstack.setCurrent_layer_count(entity.getCurrent_layer_count());
|
||||
boxstack.setBox_no(entity.getBox_no());
|
||||
boxstack.setMax_layer_count(entity.getMax_layer_count());
|
||||
boxstack.setPoint_status(entity.getPoint_status());
|
||||
boxstack.setBox_spec(entity.getBox_spec());
|
||||
@@ -82,16 +101,6 @@ public class BstIvtBoxstackServiceImpl extends ServiceImpl<BstIvtBoxstackMapper,
|
||||
boxstack.setCreated_name(currentNickName);
|
||||
boxstack.setCreated_time(now);
|
||||
boxstackMapper.insert(boxstack);
|
||||
for (Integer i = 0; i < entity.getMax_layer_count(); i++) {
|
||||
BstIvtBoxstacklayer boxstacklayer = new BstIvtBoxstacklayer();
|
||||
boxstacklayer.setStack_layer_id(IdUtil.getStringId());
|
||||
boxstacklayer.setStack_id(boxstack.getStack_id());
|
||||
boxstacklayer.setLayer_index(i + 1);
|
||||
boxstacklayer.setCreated_id(currentUserId);
|
||||
boxstacklayer.setCreated_name(currentNickName);
|
||||
boxstacklayer.setCreated_time(now);
|
||||
boxstacklayerService.save(boxstacklayer);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,6 +108,28 @@ public class BstIvtBoxstackServiceImpl extends ServiceImpl<BstIvtBoxstackMapper,
|
||||
public void update(BstIvtBoxstackDto entity) {
|
||||
BstIvtBoxstack boxstack = this.getById(entity.getStack_id());
|
||||
if (ObjectUtil.isNotNull(boxstack)) {
|
||||
String box_no = entity.getBox_no();
|
||||
if (StringUtils.isBlank(box_no)) {
|
||||
boxstack.setCurrent_layer_count(0);
|
||||
if (StringUtils.isNotBlank(entity.getBox_spec())) {
|
||||
throw new BadRequestException("木箱码为空,木箱规格也必须为空");
|
||||
}
|
||||
} else {
|
||||
if (StringUtils.isBlank(entity.getBox_spec())) {
|
||||
throw new BadRequestException("木箱码不为空,木箱规格也不能为空");
|
||||
}
|
||||
String[] boxNos = box_no.split(",");
|
||||
for (int i = 0; i < boxNos.length; i++) {
|
||||
String boxNo = boxNos[i];
|
||||
BstIvtBoxinfo boxinfo = boxinfoService.getOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||
if (ObjectUtil.isNull(boxinfo)) {
|
||||
throw new BadRequestException("木箱码:" + boxNo + "在木箱信息表中不存在");
|
||||
}
|
||||
}
|
||||
boxstack.setCurrent_layer_count(boxNos.length);
|
||||
}
|
||||
boxstack.setBox_spec(entity.getBox_spec());
|
||||
boxstack.setBox_no(entity.getBox_no());
|
||||
boxstack.setStack_code(entity.getStack_code());
|
||||
boxstack.setStack_name(entity.getStack_name());
|
||||
boxstack.setPoint_status(entity.getPoint_status());
|
||||
@@ -115,71 +146,70 @@ public class BstIvtBoxstackServiceImpl extends ServiceImpl<BstIvtBoxstackMapper,
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Set<String> ids) {
|
||||
boxstackMapper.deleteBatchIds(ids);
|
||||
boxstacklayerService.remove(new LambdaQueryWrapper<BstIvtBoxstacklayer>().in(BstIvtBoxstacklayer::getStack_id, ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveBoxStack(JSONObject reqParam) {
|
||||
String box_spec = reqParam.getString("box_spec");
|
||||
String stack_id = reqParam.getString("stack_id");
|
||||
JSONArray layers = reqParam.getJSONArray("tableData");
|
||||
int current_layer_count = reqParam.getIntValue("current_layer_count");
|
||||
boolean hasBoxSpec = StringUtils.isNotBlank(box_spec);
|
||||
|
||||
List<String> boxCodes = layers.stream()
|
||||
.map(obj -> {
|
||||
if (obj instanceof JSONObject) {
|
||||
return ((JSONObject) obj).getString("box_code");
|
||||
} else if (obj instanceof Map) {
|
||||
return (String) ((Map<?, ?>) obj).get("box_code");
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
boolean allBoxCodesEmpty = boxCodes.stream()
|
||||
.allMatch(code -> StringUtils.isBlank(code));
|
||||
boolean anyBoxCodeNotEmpty = boxCodes.stream()
|
||||
.anyMatch(code -> StringUtils.isNotBlank(code));
|
||||
|
||||
if (!hasBoxSpec && anyBoxCodeNotEmpty) {
|
||||
throw new BadRequestException("木箱规格为空,但是木箱条码不为空");
|
||||
}
|
||||
if (hasBoxSpec && allBoxCodesEmpty) {
|
||||
throw new BadRequestException("木箱规格不为空,但是木箱条码全部为空");
|
||||
}
|
||||
String now = DateUtil.now();
|
||||
String currentNickName = SecurityUtils.getCurrentNickName();
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
for (int i = 0; i < layers.size(); i++) {
|
||||
JSONObject layer = layers.getJSONObject(i);
|
||||
String stack_layer_id = layer.getString("stack_layer_id");
|
||||
String box_code = layer.getString("box_code");
|
||||
if (StringUtils.isNotBlank(box_code)) {
|
||||
BstIvtBoxinfo boxinfo = boxinfoService.getOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, box_code));
|
||||
if (ObjectUtil.isEmpty(boxinfo)) {
|
||||
throw new BadRequestException("请核对木箱号, 木箱号:" + box_code + "在木箱信息表中不存在");
|
||||
}
|
||||
}
|
||||
BstIvtBoxstacklayer boxstacklayer = boxstacklayerService.getOne(new LambdaQueryWrapper<BstIvtBoxstacklayer>()
|
||||
.eq(BstIvtBoxstacklayer::getStack_layer_id, stack_layer_id));
|
||||
if (!ObjectUtil.isEmpty(boxstacklayer)) {
|
||||
boxstacklayer.setBox_code(box_code);
|
||||
boxstacklayer.setUpdate_time(now);
|
||||
boxstacklayer.setUpdate_id(currentUserId);
|
||||
boxstacklayer.setUpdate_name(currentNickName);
|
||||
boxstacklayerService.updateById(boxstacklayer);
|
||||
}
|
||||
}
|
||||
BstIvtBoxstack boxstack = this.getOne(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getStack_id, stack_id));
|
||||
if (!ObjectUtil.isEmpty(boxstack)) {
|
||||
boxstack.setBox_spec(box_spec);
|
||||
boxstack.setCurrent_layer_count(current_layer_count);
|
||||
boxstack.setUpdate_time(now);
|
||||
boxstack.setUpdate_id(currentUserId);
|
||||
boxstack.setUpdate_name(currentNickName);
|
||||
this.updateById(boxstack);
|
||||
}
|
||||
// String box_spec = reqParam.getString("box_spec");
|
||||
// String stack_id = reqParam.getString("stack_id");
|
||||
// JSONArray layers = reqParam.getJSONArray("tableData");
|
||||
// int current_layer_count = reqParam.getIntValue("current_layer_count");
|
||||
// boolean hasBoxSpec = StringUtils.isNotBlank(box_spec);
|
||||
//
|
||||
// List<String> boxCodes = layers.stream()
|
||||
// .map(obj -> {
|
||||
// if (obj instanceof JSONObject) {
|
||||
// return ((JSONObject) obj).getString("box_code");
|
||||
// } else if (obj instanceof Map) {
|
||||
// return (String) ((Map<?, ?>) obj).get("box_code");
|
||||
// }
|
||||
// return null;
|
||||
// })
|
||||
// .collect(Collectors.toList());
|
||||
// boolean allBoxCodesEmpty = boxCodes.stream()
|
||||
// .allMatch(code -> StringUtils.isBlank(code));
|
||||
// boolean anyBoxCodeNotEmpty = boxCodes.stream()
|
||||
// .anyMatch(code -> StringUtils.isNotBlank(code));
|
||||
//
|
||||
// if (!hasBoxSpec && anyBoxCodeNotEmpty) {
|
||||
// throw new BadRequestException("木箱规格为空,但是木箱条码不为空");
|
||||
// }
|
||||
// if (hasBoxSpec && allBoxCodesEmpty) {
|
||||
// throw new BadRequestException("木箱规格不为空,但是木箱条码全部为空");
|
||||
// }
|
||||
// String now = DateUtil.now();
|
||||
// String currentNickName = SecurityUtils.getCurrentNickName();
|
||||
// String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
// for (int i = 0; i < layers.size(); i++) {
|
||||
// JSONObject layer = layers.getJSONObject(i);
|
||||
// String stack_layer_id = layer.getString("stack_layer_id");
|
||||
// String box_code = layer.getString("box_code");
|
||||
// if (StringUtils.isNotBlank(box_code)) {
|
||||
// BstIvtBoxinfo boxinfo = boxinfoService.getOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, box_code));
|
||||
// if (ObjectUtil.isEmpty(boxinfo)) {
|
||||
// throw new BadRequestException("请核对木箱号, 木箱号:" + box_code + "在木箱信息表中不存在");
|
||||
// }
|
||||
// }
|
||||
// BstIvtBoxStockUpPlan boxstacklayer = boxstacklayerService.getOne(new LambdaQueryWrapper<BstIvtBoxStockUpPlan>()
|
||||
// .eq(BstIvtBoxStockUpPlan::getStack_layer_id, stack_layer_id));
|
||||
// if (!ObjectUtil.isEmpty(boxstacklayer)) {
|
||||
// boxstacklayer.setBox_code(box_code);
|
||||
// boxstacklayer.setUpdate_time(now);
|
||||
// boxstacklayer.setUpdate_id(currentUserId);
|
||||
// boxstacklayer.setUpdate_name(currentNickName);
|
||||
// boxstacklayerService.updateById(boxstacklayer);
|
||||
// }
|
||||
// }
|
||||
// BstIvtBoxstack boxstack = this.getOne(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
// .eq(BstIvtBoxstack::getStack_id, stack_id));
|
||||
// if (!ObjectUtil.isEmpty(boxstack)) {
|
||||
// boxstack.setBox_spec(box_spec);
|
||||
// boxstack.setCurrent_layer_count(current_layer_count);
|
||||
// boxstack.setUpdate_time(now);
|
||||
// boxstack.setUpdate_id(currentUserId);
|
||||
// boxstack.setUpdate_name(currentNickName);
|
||||
// this.updateById(boxstack);
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.nl.b_lms.bst.ivt.boxstack.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstacklayerService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstacklayer;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.mapper.BstIvtBoxstacklayerMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
* @Author Gengby
|
||||
* @Date 2025/7/8
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class BstIvtBoxstacklayerServiceImpl extends ServiceImpl<BstIvtBoxstacklayerMapper, BstIvtBoxstacklayer> implements IBstIvtBoxstacklayerService {
|
||||
|
||||
@Override
|
||||
public List<BstIvtBoxstacklayer> getByStackId(String stackId) {
|
||||
return this.list(new LambdaQueryWrapper<BstIvtBoxstacklayer>().eq(BstIvtBoxstacklayer::getStack_id, stackId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,31 +1,32 @@
|
||||
package org.nl.b_lms.pda.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.enums.BoxStackEnum;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstackService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack;
|
||||
import org.nl.b_lms.pda.service.BoxStackInOutService;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.boxstack.MxInTask;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.dao.BstIvtBoxinfo;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.system.service.param.dao.Param;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description TODO
|
||||
@@ -47,85 +48,70 @@ public class BoxStackInOutServiceImpl implements BoxStackInOutService {
|
||||
private IschBaseTaskService taskService;
|
||||
@Resource
|
||||
private IBstIvtBoxstackService boxstackService;
|
||||
@Resource
|
||||
private ISysParamService paramService;
|
||||
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public void boxIn(JSONObject reqParam) {
|
||||
String point_code = reqParam.getString("point_code");
|
||||
if (StringUtils.isBlank(point_code)) {
|
||||
String pointCode = reqParam.getString("point_code");
|
||||
if (StringUtils.isBlank(pointCode)) {
|
||||
throw new BadRequestException("请输入入库点位");
|
||||
}
|
||||
PointDto pointDto = pointService.findByCode(point_code);
|
||||
if (ObjectUtil.isEmpty(pointDto)) {
|
||||
throw new BadRequestException("入库点位不存在");
|
||||
}
|
||||
String vehicle_code = reqParam.getString("vehicle_code");
|
||||
if (StringUtils.isBlank(vehicle_code)) {
|
||||
Optional.ofNullable(pointService.findByCode(pointCode))
|
||||
.orElseThrow(() -> new BadRequestException("入库点位不存在"));
|
||||
|
||||
String vehicleCodeStr = reqParam.getString("vehicle_code");
|
||||
if (StringUtils.isBlank(vehicleCodeStr)) {
|
||||
throw new BadRequestException("请输入木箱号");
|
||||
}
|
||||
String[] vehicle_codes = vehicle_code.split(",");
|
||||
List<String> box_specs = new ArrayList<>();
|
||||
for (String vehicle_code1 : vehicle_codes) {
|
||||
if (StringUtils.isBlank(vehicle_code1)) {
|
||||
BstIvtBoxinfo boxinfo = boxinfoService.getOne(new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, vehicle_code1));
|
||||
String[] vehicleCodes = vehicleCodeStr.split(",");
|
||||
List<String> boxSpecs = new ArrayList<>();
|
||||
|
||||
for (String boxNo : vehicleCodes) {
|
||||
if (StringUtils.isNotBlank(boxNo)) {
|
||||
BstIvtBoxinfo boxinfo = boxinfoService.getOne(
|
||||
new LambdaQueryWrapper<BstIvtBoxinfo>().eq(BstIvtBoxinfo::getBox_no, boxNo));
|
||||
if (ObjectUtil.isEmpty(boxinfo)) {
|
||||
throw new BadRequestException("木箱号:" + vehicle_code1 + "不存在");
|
||||
throw new BadRequestException("木箱号: " + boxNo + " 不存在");
|
||||
}
|
||||
box_specs.add(boxinfo.getMaterial_code());
|
||||
boxSpecs.add(boxinfo.getMaterial_code());
|
||||
}
|
||||
}
|
||||
String firstMaterial = box_specs.get(0);
|
||||
boolean allMatch = box_specs.stream().allMatch(code -> code.equals(firstMaterial));
|
||||
|
||||
if (boxSpecs.isEmpty()) {
|
||||
throw new BadRequestException("未检测到有效木箱号");
|
||||
}
|
||||
|
||||
String firstMaterial = boxSpecs.get(0);
|
||||
boolean allMatch = boxSpecs.stream().allMatch(code -> code.equals(firstMaterial));
|
||||
if (!allMatch) {
|
||||
throw new BadRequestException("木箱规格不一致");
|
||||
}
|
||||
|
||||
String boxAreaRelationStr = Optional.ofNullable(paramService.findByCode("box_area_relation"))
|
||||
.map(Param::getValue)
|
||||
.orElseThrow(() -> new BadRequestException("请配置木箱规格区域对应关系"));
|
||||
|
||||
JSONObject boxAreaRelationJSON = JSONObject.parseObject(boxAreaRelationStr);
|
||||
String boxArea = boxAreaRelationJSON.getString(firstMaterial);
|
||||
if (StringUtils.isBlank(boxArea)) {
|
||||
throw new BadRequestException("请配置木箱规格: " + firstMaterial + " 的区域");
|
||||
}
|
||||
|
||||
RLock lock = redissonClient.getLock("boxIn");
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
//查询第一排非缓存区的并且无货的库位
|
||||
List<BstIvtBoxstack> noHasGoodsPointList = boxstackService.list(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.isNull(BstIvtBoxstack::getBox_spec)
|
||||
.notIn(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("缓存区"))
|
||||
.eq(BstIvtBoxstack::getX, 1)
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用")));
|
||||
//判断是否满足最大数量,如果不满足
|
||||
if (noHasGoodsPointList.size() <= 3) {
|
||||
//获取相同木箱规格的的第一排的库位
|
||||
List<BstIvtBoxstack> hasGoodsPointList = boxstackService.list(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getBox_spec, firstMaterial)
|
||||
.notIn(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("缓存区"))
|
||||
.eq(BstIvtBoxstack::getX, 1)
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用")));
|
||||
//遍历相同木箱规格同列不同排的库位是否大于最大数量
|
||||
int currentCanUseCount = 0;
|
||||
for (BstIvtBoxstack bstIvtBoxstack : hasGoodsPointList) {
|
||||
Integer x = bstIvtBoxstack.getX();
|
||||
Integer y = bstIvtBoxstack.getY();
|
||||
List<BstIvtBoxstack> list = boxstackService.list(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.isNull(BstIvtBoxstack::getBox_spec)
|
||||
.eq(BstIvtBoxstack::getY, y)
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用"))
|
||||
.notIn(BstIvtBoxstack::getX, x)
|
||||
.notIn(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("缓存区")));
|
||||
currentCanUseCount += list.size();
|
||||
if (!tryLock) {
|
||||
throw new BadRequestException("系统繁忙,请稍后重试");
|
||||
}
|
||||
if (currentCanUseCount <= 3) {
|
||||
List<String> taskTypes = new ArrayList<>(Collections.singletonList(BoxStackEnum.TASK_TYPE.code("木箱入库")));
|
||||
List<SchBaseTask> existTask = taskService.getExistTasks(taskTypes);
|
||||
if (existTask.size() >= 3) {
|
||||
throw new BadRequestException("木箱入库任务超过最大数量");
|
||||
}
|
||||
}
|
||||
}
|
||||
JSONObject taskParam = new JSONObject();
|
||||
taskParam.put("material_code", box_specs.get(0));
|
||||
taskParam.put("vehicle_code", vehicle_code);
|
||||
taskParam.put("vehicle_code2", BoxStackEnum.AGV_ACTION_TYPE.code("放货二次分配"));
|
||||
taskParam.put("task_type", BoxStackEnum.TASK_TYPE.code("木箱入库"));
|
||||
taskParam.put("point_code1", point_code);
|
||||
taskParam.put("point_code2", BoxStackEnum.AGV_WAIT_POINT.code("木箱等待点1"));
|
||||
mxInTask.createTask(reqParam);
|
||||
|
||||
if (StrUtil.equals(boxArea, BoxStackEnum.POINT_STATUS.code("零散区"))) {
|
||||
handleLooseAreaIn(pointCode, firstMaterial, vehicleCodeStr);
|
||||
} else if (StrUtil.equals(boxArea, BoxStackEnum.POINT_STATUS.code("密集区"))) {
|
||||
handleDenseAreaIn(pointCode, firstMaterial, vehicleCodeStr);
|
||||
} else {
|
||||
throw new BadRequestException("不支持的区域配置: " + boxArea);
|
||||
}
|
||||
} finally {
|
||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||
@@ -133,4 +119,126 @@ public class BoxStackInOutServiceImpl implements BoxStackInOutService {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void handleLooseAreaIn(String pointCode, String firstMaterial, String vehicleCodeStr) {
|
||||
List<BstIvtBoxstack> emptyLoosePoints = boxstackService.list(
|
||||
new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.isNull(BstIvtBoxstack::getBox_spec)
|
||||
.eq(BstIvtBoxstack::getCurrent_layer_count, 0)
|
||||
.eq(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("零散区"))
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用"))
|
||||
);
|
||||
if (CollectionUtils.isEmpty(emptyLoosePoints)) {
|
||||
throw new BadRequestException("该木箱规格在零散区未找到可用库位");
|
||||
}
|
||||
|
||||
for (BstIvtBoxstack stack : emptyLoosePoints) {
|
||||
if (CollectionUtils.isEmpty(taskService.checkHaveTask(stack.getStack_code()))) {
|
||||
JSONObject taskParam = buildTaskParam(firstMaterial, vehicleCodeStr,
|
||||
BoxStackEnum.AGV_ACTION_TYPE.code("普通任务"),
|
||||
BoxStackEnum.TASK_TYPE.code("木箱入库"),
|
||||
pointCode, stack.getStack_code());
|
||||
mxInTask.createTask(taskParam);
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new BadRequestException("零散区无可用库位可执行任务,请稍后重试");
|
||||
}
|
||||
|
||||
private void handleDenseAreaIn(String pointCode, String firstMaterial, String vehicleCodeStr) {
|
||||
List<BstIvtBoxstack> firstRowWithMaterial = boxstackService.list(
|
||||
new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getBox_spec, firstMaterial)
|
||||
.eq(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("密集区"))
|
||||
.eq(BstIvtBoxstack::getX, 1)
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用"))
|
||||
);
|
||||
|
||||
if (!CollectionUtils.isEmpty(firstRowWithMaterial)) {
|
||||
for (BstIvtBoxstack stack : firstRowWithMaterial) {
|
||||
Integer y = stack.getY();
|
||||
|
||||
List<BstIvtBoxstack> emptyPointsInColumn = boxstackService.list(
|
||||
new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.isNull(BstIvtBoxstack::getBox_spec)
|
||||
.eq(BstIvtBoxstack::getCurrent_layer_count, 0)
|
||||
.eq(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("密集区"))
|
||||
.eq(BstIvtBoxstack::getY, y)
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用"))
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(emptyPointsInColumn)) continue;
|
||||
|
||||
List<String> emptyStackCodes = emptyPointsInColumn.stream()
|
||||
.map(BstIvtBoxstack::getStack_code)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
BstIvtBoxstack waitPoint = boxstackService.getOne(
|
||||
new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("等待区"))
|
||||
.eq(BstIvtBoxstack::getY, y)
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用"))
|
||||
);
|
||||
|
||||
if (waitPoint == null) continue;
|
||||
|
||||
int waitingTasks = taskService.checkHaveTaskByNext(Arrays.asList(waitPoint.getStack_code())).size();
|
||||
int assignTasks = taskService.checkHaveTaskByNext(emptyStackCodes).size();
|
||||
|
||||
if (emptyPointsInColumn.size() > waitingTasks + assignTasks) {
|
||||
JSONObject taskParam = buildTaskParam(firstMaterial, vehicleCodeStr,
|
||||
BoxStackEnum.AGV_ACTION_TYPE.code("放货二次分配"),
|
||||
BoxStackEnum.TASK_TYPE.code("木箱入库"),
|
||||
pointCode, waitPoint.getStack_code());
|
||||
mxInTask.createTask(taskParam);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<BstIvtBoxstack> firstRowEmpty = boxstackService.list(
|
||||
new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.isNull(BstIvtBoxstack::getBox_spec)
|
||||
.eq(BstIvtBoxstack::getCurrent_layer_count, 0)
|
||||
.eq(BstIvtBoxstack::getX, 1)
|
||||
.eq(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("密集区"))
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用"))
|
||||
);
|
||||
|
||||
if (CollectionUtils.isEmpty(firstRowEmpty)) {
|
||||
throw new BadRequestException("无可用货位,请稍后入库");
|
||||
}
|
||||
|
||||
BstIvtBoxstack selectedStack = firstRowEmpty.get(0);
|
||||
BstIvtBoxstack waitPoint = boxstackService.getOne(
|
||||
new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("等待区"))
|
||||
.eq(BstIvtBoxstack::getY, selectedStack.getY())
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用"))
|
||||
);
|
||||
|
||||
if (waitPoint == null) {
|
||||
throw new BadRequestException("未找到对应等待区位置,请检查配置");
|
||||
}
|
||||
|
||||
JSONObject taskParam = buildTaskParam(firstMaterial, vehicleCodeStr,
|
||||
BoxStackEnum.AGV_ACTION_TYPE.code("放货二次分配"),
|
||||
BoxStackEnum.TASK_TYPE.code("木箱入库"),
|
||||
pointCode, waitPoint.getStack_code());
|
||||
mxInTask.createTask(taskParam);
|
||||
}
|
||||
|
||||
private JSONObject buildTaskParam(String materialCode, String vehicleCode,
|
||||
String vehicleCode2, String taskType,
|
||||
String pointCode1, String pointCode2) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("material_code", materialCode);
|
||||
obj.put("vehicle_code", vehicleCode);
|
||||
obj.put("vehicle_code2", vehicleCode2);
|
||||
obj.put("task_type", taskType);
|
||||
obj.put("point_code1", pointCode1);
|
||||
obj.put("point_code2", pointCode2);
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -56,6 +56,7 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 获取下发的任务
|
||||
*
|
||||
* @param thisClass 类
|
||||
* @return /
|
||||
*/
|
||||
@@ -63,6 +64,7 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 检测点位编码是否存在任务
|
||||
*
|
||||
* @param code 点位编码
|
||||
* @return 任务
|
||||
*/
|
||||
@@ -77,14 +79,14 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
List<SchBaseTask> getTaskByPlanQzzNoAndDevice(String resourceName);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*校验相同任务类型
|
||||
* 校验相同任务类型
|
||||
*/
|
||||
List<SchBaseTask> getExistTasks(List<String> taskTypes);
|
||||
|
||||
/**
|
||||
* 查找暂存位置是否有任务,包括桁架任务
|
||||
*
|
||||
* @param point /
|
||||
* @return /
|
||||
*/
|
||||
@@ -92,6 +94,7 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 判断是否有起点未完成的任务
|
||||
*
|
||||
* @param pointCode
|
||||
* @return
|
||||
*/
|
||||
@@ -101,12 +104,15 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 获取可以使用的任务数组
|
||||
*
|
||||
* @param handleClass 任务类
|
||||
* @return
|
||||
*/
|
||||
List<SchBaseTask> getTaskingByHandleClass(String handleClass);
|
||||
|
||||
/**
|
||||
* 获取可以使用的任务数组Object
|
||||
*
|
||||
* @param handleClass 任务类
|
||||
* @return
|
||||
*/
|
||||
@@ -114,6 +120,7 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 根据单据id获取执行中的任务
|
||||
*
|
||||
* @param iostorinvId
|
||||
* @return
|
||||
*/
|
||||
@@ -121,6 +128,7 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 根据条件获取任务数据
|
||||
*
|
||||
* @param taskLam 条件
|
||||
* @param flag 是否抛出异常 {@code true} 查询到多条会抛出异常,{@code false} 查询多条获取第一条
|
||||
* @return 一条数据SchBaseTask 或 {@code null}
|
||||
@@ -129,6 +137,7 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 根据ids获取任务
|
||||
*
|
||||
* @param taskIds 标识数组
|
||||
* @param flag 是否判断没有删除的任务
|
||||
* @return
|
||||
@@ -137,12 +146,21 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
|
||||
|
||||
/**
|
||||
* 根据ids获取任务
|
||||
*
|
||||
* @param taskIds 标识数组
|
||||
* @param flag 是否判断没有删除的任务
|
||||
* @return
|
||||
*/
|
||||
List<JSONObject> getTaskByIdsToObject(List<String> taskIds, boolean flag);
|
||||
|
||||
|
||||
/**
|
||||
* 查询point2的任务
|
||||
*
|
||||
* @param noHasGoodsPointCodeList
|
||||
* @return
|
||||
*/
|
||||
List<SchBaseTask> checkHaveTaskByNext(List<String> noHasGoodsPointCodeList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -245,6 +245,14 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
|
||||
return CollectionUtils.mapList(getTaskByIds(taskIds, flag), task -> (JSONObject) JSON.toJSON(task));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SchBaseTask> checkHaveTaskByNext(List<String> noHasGoodsPointCodeList) {
|
||||
LambdaQueryWrapper<SchBaseTask> lqw = new QueryWrapper<SchBaseTask>().lambda();
|
||||
lqw.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
|
||||
.and(la -> la.in(SchBaseTask::getPoint_code2, noHasGoodsPointCodeList));
|
||||
return list(lqw);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,11 +11,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.enums.BoxStackEnum;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstackService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstacklayerService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstacklayer;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.dto.SchBaseTaskVO;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
@@ -34,6 +33,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -53,8 +53,6 @@ public class MxInTask extends AbstractAcsTask {
|
||||
private IschBaseTaskService taskService;
|
||||
@Resource
|
||||
private IBstIvtBoxstackService boxstackService;
|
||||
@Resource
|
||||
private IBstIvtBoxstacklayerService boxstacklayerService;
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
@@ -111,20 +109,8 @@ public class MxInTask extends AbstractAcsTask {
|
||||
BstIvtBoxstack boxstack = boxstackService.getOne(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getStack_code, schBaseTask.getPoint_code2()));
|
||||
if (!ObjectUtil.isEmpty(boxstack)) {
|
||||
for (int i = 0; i < boxNos.length; i++) {
|
||||
//修改每层的木箱号信息
|
||||
String boxNo = boxNos[i];
|
||||
BstIvtBoxstacklayer boxstacklayer = boxstacklayerService.getOne(new LambdaQueryWrapper<BstIvtBoxstacklayer>()
|
||||
.eq(BstIvtBoxstacklayer::getStack_id, boxstack.getStack_id())
|
||||
.eq(BstIvtBoxstacklayer::getLayer_index, i + 1));
|
||||
if (!ObjectUtil.isEmpty(boxstacklayer)) {
|
||||
boxstacklayer.setBox_code(boxNo);
|
||||
boxstacklayer.setUpdate_time(now);
|
||||
boxstacklayer.setUpdate_id(currentUserId);
|
||||
boxstacklayer.setUpdate_name(currentNickName);
|
||||
boxstacklayerService.updateById(boxstacklayer);
|
||||
}
|
||||
}
|
||||
boxstack.setBox_no(vehicle_code);
|
||||
boxstack.setCurrent_layer_count(boxNos.length);
|
||||
boxstack.setBox_spec(box_spec);
|
||||
boxstack.setUpdate_time(now);
|
||||
boxstack.setUpdate_id(currentUserId);
|
||||
@@ -223,4 +209,41 @@ public class MxInTask extends AbstractAcsTask {
|
||||
updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + DateUtil.now() + "强制取消。");
|
||||
taskService.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
public String againPutPoint(String taskCode) {
|
||||
SchBaseTask baseTask = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>()
|
||||
.eq(SchBaseTask::getTask_code, taskCode)
|
||||
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_SEND.code("否"))
|
||||
.eq(SchBaseTask::getTask_status, TaskStatusEnum.EXECUTING.getCode()));
|
||||
if (baseTask == null) {
|
||||
throw new BadRequestException("该任务未执行或不存在!");
|
||||
}
|
||||
//获取木箱规格
|
||||
String point_code2 = baseTask.getPoint_code2();
|
||||
BstIvtBoxstack boxstack = boxstackService.getOne(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getStack_code, point_code2)
|
||||
.eq(BstIvtBoxstack::getIs_used, IOSEnum.IS_NOTANDYES.code("是")));
|
||||
if (boxstack == null) {
|
||||
throw new BadRequestException("等待点不存在!");
|
||||
}
|
||||
Integer y = boxstack.getY();
|
||||
List<BstIvtBoxstack> list = boxstackService.list(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getY, y)
|
||||
.eq(BstIvtBoxstack::getIs_used, IOSEnum.IS_NOTANDYES.code("是"))
|
||||
.eq(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("密集区"))
|
||||
.isNull(BstIvtBoxstack::getBox_spec)
|
||||
.eq(BstIvtBoxstack::getCurrent_layer_count, 0)
|
||||
.orderByAsc(BstIvtBoxstack::getX));
|
||||
for (BstIvtBoxstack bstIvtBoxstack : list) {
|
||||
List<SchBaseTask> schBaseTasks = taskService.checkHaveTaskByNext(Arrays.asList(bstIvtBoxstack.getStack_code()));
|
||||
if (CollectionUtils.isEmpty(schBaseTasks)) {
|
||||
baseTask.setPoint_code2(bstIvtBoxstack.getStack_code());
|
||||
baseTask.setRemark("二次分配成功");
|
||||
baseTask.setUpdate_time(DateUtil.now());
|
||||
taskService.updateById(baseTask);
|
||||
return bstIvtBoxstack.getStack_code();
|
||||
}
|
||||
}
|
||||
throw new BadRequestException("等待点所在列暂时无空位!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,9 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstackService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstacklayerService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxStockUpPlanService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxStockUpPlan;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstacklayer;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.dto.SchBaseTaskVO;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
@@ -53,7 +53,7 @@ public class MxMoveTask extends AbstractAcsTask {
|
||||
@Resource
|
||||
private IBstIvtBoxstackService boxstackService;
|
||||
@Resource
|
||||
private IBstIvtBoxstacklayerService boxstacklayerService;
|
||||
private IBstIvtBoxStockUpPlanService boxstacklayerService;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -113,18 +113,19 @@ public class MxMoveTask extends AbstractAcsTask {
|
||||
if (!ObjectUtil.isEmpty(boxstack)) {
|
||||
for (int i = 0; i < boxNos.length; i++) {
|
||||
//修改每层的木箱号信息
|
||||
String boxNo = boxNos[i];
|
||||
BstIvtBoxstacklayer boxstacklayer = boxstacklayerService.getOne(new LambdaQueryWrapper<BstIvtBoxstacklayer>()
|
||||
.eq(BstIvtBoxstacklayer::getStack_id, boxstack.getStack_id())
|
||||
.eq(BstIvtBoxstacklayer::getLayer_index, i + 1));
|
||||
if (!ObjectUtil.isEmpty(boxstacklayer)) {
|
||||
boxstacklayer.setBox_code(boxNo);
|
||||
boxstacklayer.setUpdate_time(now);
|
||||
boxstacklayer.setUpdate_id(currentUserId);
|
||||
boxstacklayer.setUpdate_name(currentNickName);
|
||||
boxstacklayerService.updateById(boxstacklayer);
|
||||
}
|
||||
// String boxNo = boxNos[i];
|
||||
// BstIvtBoxStockUpPlan boxstacklayer = boxstacklayerService.getOne(new LambdaQueryWrapper<BstIvtBoxStockUpPlan>()
|
||||
// .eq(BstIvtBoxStockUpPlan::getStack_id, boxstack.getStack_id())
|
||||
// .eq(BstIvtBoxStockUpPlan::getLayer_index, i + 1));
|
||||
// if (!ObjectUtil.isEmpty(boxstacklayer)) {
|
||||
// boxstacklayer.setBox_code(boxNo);
|
||||
// boxstacklayer.setUpdate_time(now);
|
||||
// boxstacklayer.setUpdate_id(currentUserId);
|
||||
// boxstacklayer.setUpdate_name(currentNickName);
|
||||
// boxstacklayerService.updateById(boxstacklayer);
|
||||
// }
|
||||
}
|
||||
boxstack.setCurrent_layer_count(boxNos.length);
|
||||
boxstack.setBox_spec(box_spec);
|
||||
boxstack.setUpdate_time(now);
|
||||
boxstack.setUpdate_id(currentUserId);
|
||||
@@ -223,4 +224,17 @@ public class MxMoveTask extends AbstractAcsTask {
|
||||
updateWrapper.set(SchBaseTask::getRemark, "任务被用户:" + schBaseTask.getUpdate_optname() + "在:" + DateUtil.now() + "强制取消。");
|
||||
taskService.update(null, updateWrapper);
|
||||
}
|
||||
|
||||
public String againGetPoint(String taskCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String againPutPoint(String taskCode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void getFinish() {
|
||||
//更新起点库存
|
||||
//起点层数
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
package org.nl.b_lms.sch.tasks.boxstack.auto;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.enums.BoxStackEnum;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxStockUpPlanService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstackService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.IBstIvtBoxstacklayerService;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxStockUpPlan;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.service.dao.BstIvtBoxstack;
|
||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
@@ -16,6 +19,7 @@ import org.nl.b_lms.sch.tasks.boxstack.MxMoveTask;
|
||||
import org.nl.common.utils.IdUtil;
|
||||
import org.redisson.api.RLock;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -29,17 +33,20 @@ import java.util.stream.Collectors;
|
||||
@RequiredArgsConstructor
|
||||
public class AutoMxMoveTask {
|
||||
|
||||
private final String THIS_CLASS = AutoMxMoveTask.class.getName();
|
||||
|
||||
@Resource
|
||||
private IschBaseTaskService taskService;
|
||||
private final String THIS_CLASS = AutoMxMoveTask.class.getName();
|
||||
@Resource
|
||||
private RedissonClient redissonClient;
|
||||
@Resource
|
||||
private MxMoveTask mxMoveTask;
|
||||
@Resource
|
||||
private IBstIvtBoxstackService boxstackService;
|
||||
@Resource
|
||||
private IBstIvtBoxStockUpPlanService stockUpPlanService;
|
||||
|
||||
//满轴->待检区agv自动搬运任务
|
||||
//木箱备货密集区->缓存区的自动搬运任务
|
||||
public void run() {
|
||||
try {
|
||||
this.sendMxMove();
|
||||
@@ -56,6 +63,35 @@ public class AutoMxMoveTask {
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
//获取木箱备货计划
|
||||
List<BstIvtBoxStockUpPlan> stockUpPlans = stockUpPlanService.list(new LambdaQueryWrapper<BstIvtBoxStockUpPlan>()
|
||||
.eq(BstIvtBoxStockUpPlan::getStock_plan_status, BoxStackEnum.STOCK_UP_STATUS.code("未开始"))
|
||||
.eq(BstIvtBoxStockUpPlan::getStock_plan_time, DateUtil.today()));
|
||||
for (BstIvtBoxStockUpPlan stockUpPlan : stockUpPlans) {
|
||||
//备货木箱
|
||||
String box_spec = stockUpPlan.getBox_spec();
|
||||
//备货数量
|
||||
Integer stock_up_num = stockUpPlan.getStock_up_num();
|
||||
List<BstIvtBoxStockUpPlan> executingStockUpPlans = stockUpPlanService.list(new LambdaQueryWrapper<BstIvtBoxStockUpPlan>()
|
||||
.eq(BstIvtBoxStockUpPlan::getBox_spec, box_spec)
|
||||
.eq(BstIvtBoxStockUpPlan::getStock_plan_status, BoxStackEnum.STOCK_UP_STATUS.code("执行中")));
|
||||
if (executingStockUpPlans.size() > 0) {
|
||||
if (StringUtils.isNotBlank(stockUpPlan.getRemark())) {
|
||||
stockUpPlan.setRemark("有同规格的木箱移库备货计划正在执行");
|
||||
stockUpPlanService.updateById(stockUpPlan);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
//根据备货计划,从密集区或零散区查询该木箱规格的数量
|
||||
List<BstIvtBoxstack> boxstacks = boxstackService.list(new LambdaQueryWrapper<BstIvtBoxstack>()
|
||||
.eq(BstIvtBoxstack::getBox_spec, box_spec)
|
||||
.in(BstIvtBoxstack::getPoint_status, BoxStackEnum.POINT_STATUS.code("密集区"), BoxStackEnum.POINT_STATUS.code("零散区"))
|
||||
.eq(BstIvtBoxstack::getIs_used, BoxStackEnum.IS_USED.code("启用")));
|
||||
if (boxstacks.size() < stock_up_num) {
|
||||
continue;
|
||||
}
|
||||
//判断木箱库中
|
||||
}
|
||||
//获取装箱计划
|
||||
List<String> zxjhs = new ArrayList<>();
|
||||
for (String box_spec : zxjhs) {
|
||||
@@ -154,10 +190,10 @@ public class AutoMxMoveTask {
|
||||
mxMoveTask.createTask(taskParam);
|
||||
}
|
||||
// for (BstIvtBoxstack bstIvtBoxstack : hasGoodsPoint) {
|
||||
// List<BstIvtBoxstacklayer> boxstacklayerList = boxstacklayerService.list(new LambdaQueryWrapper<BstIvtBoxstacklayer>()
|
||||
// .eq(BstIvtBoxstacklayer::getStack_id, bstIvtBoxstack.getStack_id()));
|
||||
// List<BstIvtBoxStockUpPlan> boxstacklayerList = boxstacklayerService.list(new LambdaQueryWrapper<BstIvtBoxStockUpPlan>()
|
||||
// .eq(BstIvtBoxStockUpPlan::getStack_id, bstIvtBoxstack.getStack_id()));
|
||||
// String vehicle_code = boxstacklayerList.stream()
|
||||
// .map(BstIvtBoxstacklayer::getBox_code)
|
||||
// .map(BstIvtBoxStockUpPlan::getBox_code)
|
||||
// .filter(Objects::nonNull)
|
||||
// .filter(boxNo -> !boxNo.isEmpty())
|
||||
// .collect(Collectors.joining(","));
|
||||
|
||||
@@ -3,27 +3,43 @@
|
||||
<mapper namespace="org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapper">
|
||||
<select id="getPageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
count(box.material_code) AS ivt_num,
|
||||
MAX(box.material_code) AS material_code,
|
||||
stack_stat.box_spec,
|
||||
stack_stat.total_layer_count,
|
||||
MAX(box.material_name) AS material_name,
|
||||
MAX(box.box_length) AS box_length,
|
||||
MAX(box.box_width) AS box_width,
|
||||
MAX(box.box_high) AS box_high,
|
||||
MAX(box.num) AS num
|
||||
MAX(box.num) AS num,
|
||||
COUNT(box.material_code) AS ivt_num
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
box_spec,
|
||||
SUM(current_layer_count) AS total_layer_count
|
||||
FROM
|
||||
bst_ivt_boxstack
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND box_spec IS NOT NULL
|
||||
AND box_spec != ''
|
||||
GROUP BY
|
||||
box_spec
|
||||
) stack_stat
|
||||
LEFT JOIN
|
||||
bst_ivt_boxinfo box
|
||||
INNER JOIN st_ivt_structattr attr ON attr.storagevehicle_code = box.box_no
|
||||
ON box.material_code = stack_stat.box_spec
|
||||
AND box.is_packing = '0'
|
||||
<where>
|
||||
box.is_packing = '0'
|
||||
AND attr.lock_type = '1'
|
||||
AND attr.is_delete = '0'
|
||||
and attr.is_used = '1'
|
||||
1 = 1
|
||||
<if test="query.search != null and query.search != ''">
|
||||
and (box.material_code = #{query.search}
|
||||
or box.material_name LIKE '%${query.search}%')
|
||||
AND (
|
||||
box.material_code = #{query.search}
|
||||
OR box.material_name LIKE CONCAT('%', #{query.search}, '%')
|
||||
)
|
||||
</if>
|
||||
GROUP BY box.material_code
|
||||
</where>
|
||||
GROUP BY
|
||||
stack_stat.box_spec;
|
||||
</select>
|
||||
|
||||
<select id="getBoxIvtPage" resultType="java.util.Map">
|
||||
@@ -96,16 +112,13 @@
|
||||
</select>
|
||||
<select id="selectProductByName" resultType="com.alibaba.fastjson.JSONObject"
|
||||
parameterType="java.lang.String">
|
||||
SELECT
|
||||
box.box_no,
|
||||
SELECT box.box_no,
|
||||
box.material_code,
|
||||
box.material_name,
|
||||
attr.struct_code
|
||||
FROM
|
||||
bst_ivt_boxinfo box
|
||||
FROM bst_ivt_boxinfo box
|
||||
INNER JOIN st_ivt_structattr attr ON attr.storagevehicle_code = box.box_no
|
||||
WHERE
|
||||
box.is_packing = '0'
|
||||
WHERE box.is_packing = '0'
|
||||
AND attr.lock_type = '1'
|
||||
AND attr.sect_code = 'BZC01'
|
||||
AND box.material_code = #{productName}
|
||||
|
||||
@@ -2,9 +2,11 @@ package org.nl.wms.ext.acs.rest;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.logging.InterfaceLogType;
|
||||
import org.nl.modules.logging.annotation.Log;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
@@ -209,4 +211,17 @@ public class AcsToWmsController {
|
||||
public ResponseEntity<Object> forceMove(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(acsToWmsService.forceMove(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/secondaryAllocationPoint")
|
||||
@Log("二次分配")
|
||||
@SaIgnore
|
||||
ResponseEntity<Object> secondaryAllocationPoint(@RequestBody JSONObject whereJson) {
|
||||
log.info("木箱库二次分配接口请求参数:---------------------------------------------" + whereJson.toString());
|
||||
String taskCode = whereJson.getString("taskCode");
|
||||
String actionType = whereJson.getString("actionType");
|
||||
if (StrUtil.isEmpty(whereJson.getString("taskCode")) || StrUtil.isEmpty(whereJson.getString("actionType"))) {
|
||||
throw new BadRequestException("任务编号或动作类型不能为空!");
|
||||
}
|
||||
return new ResponseEntity<>(acsToWmsService.secondaryAllocationPoint(taskCode, actionType), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,6 @@ public interface AcsToWmsService {
|
||||
String againApply(String task_id);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ACS给WMS下发工单强制完成状态
|
||||
*
|
||||
@@ -55,8 +53,6 @@ public interface AcsToWmsService {
|
||||
JSONObject shipDeviceUpdate(JSONObject whereJson);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ACS客户端--->LMS服务端
|
||||
* 输送线光电无货上报
|
||||
@@ -70,6 +66,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 2、反馈尺寸;3、申请放货;4、申请取货;6、套轴申请;7、套轴完成;8、拔轴完成;9、反馈重量
|
||||
*
|
||||
* @param whereJson
|
||||
* @return
|
||||
*/
|
||||
@@ -85,19 +82,16 @@ public interface AcsToWmsService {
|
||||
void initPoint();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 二期入库任务申请
|
||||
*
|
||||
* @param whereJson {
|
||||
* type:任务类型(1-成品入库任务 2-空盘入库 3-空盘出库 4-异常处理位)
|
||||
* device_code:设备号
|
||||
* vehicle_code:载具号
|
||||
* material_barcode:子卷编码(a,b,c)
|
||||
* container_type:托盘类型(1-小托盘 2-大托盘)
|
||||
*
|
||||
* <p>
|
||||
* }
|
||||
* @return JSONObject 反馈状态
|
||||
*/
|
||||
@@ -105,6 +99,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期发货申请任务
|
||||
*
|
||||
* @param whereJson {
|
||||
* device_code: 设备号
|
||||
* vehicle_code: 载具号
|
||||
@@ -115,6 +110,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期申请捆扎、贴标
|
||||
*
|
||||
* @param whereJson {
|
||||
* device_code: 设备号
|
||||
* vehicle_code: 载具号
|
||||
@@ -126,8 +122,8 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期任务异常反馈
|
||||
* @param whereJson:{
|
||||
* type :异常类型
|
||||
*
|
||||
* @param whereJson:{ type :异常类型
|
||||
* task_code : 任务编码
|
||||
* }
|
||||
* @return JSONObject {
|
||||
@@ -138,6 +134,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期分切请求
|
||||
*
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
@@ -145,6 +142,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期套管工位请求判断去成品还是废箔
|
||||
*
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
@@ -152,6 +150,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期ACS反馈子卷重量
|
||||
*
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
@@ -159,6 +158,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期输送机申请贴标
|
||||
*
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
@@ -166,6 +166,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期输送机申请贴标
|
||||
*
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
@@ -173,6 +174,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二楼取货完成请求
|
||||
*
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
@@ -180,6 +182,7 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期ACS请求出轴
|
||||
*
|
||||
* @param param /
|
||||
* @return /
|
||||
*/
|
||||
@@ -187,17 +190,16 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 捆扎模版
|
||||
* @param param:{
|
||||
*
|
||||
* }
|
||||
* @param param:{ }
|
||||
* @return JSONObject
|
||||
*/
|
||||
JSONObject getIsUncap(JSONObject param);
|
||||
|
||||
/**
|
||||
* 二期捆扎位ACS请求强制离开
|
||||
* @param param:{
|
||||
* deviceCode: 捆扎点位
|
||||
*
|
||||
* @param param:{ deviceCode: 捆扎点位
|
||||
* }
|
||||
* @return JSONObject
|
||||
*/
|
||||
@@ -205,8 +207,18 @@ public interface AcsToWmsService {
|
||||
|
||||
/**
|
||||
* 二期请求放货/取货
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
JSONObject acsRequestPoint(JSONObject param);
|
||||
|
||||
/**
|
||||
* 木箱库点位二次分配
|
||||
*
|
||||
* @param taskCode 任务编号
|
||||
* @param actionType 动作类型:1、无动作 2、取货二次分配 3、放货二次分配 4、取放货二次分配
|
||||
* @return JSONObject 返回信息
|
||||
*/
|
||||
Map<String, Object> secondaryAllocationPoint(String taskCode, String actionType);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.b_lms.bst.ivt.boxstack.enums.BoxStackEnum;
|
||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.IBstIvtShafttubeivtService;
|
||||
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
||||
import org.nl.b_lms.pda.service.ProductOutTwoService;
|
||||
@@ -31,6 +32,8 @@ import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||
import org.nl.b_lms.sch.tasks.TwoBoxExcepTask;
|
||||
import org.nl.b_lms.sch.tasks.TwoExceptionInTask;
|
||||
import org.nl.b_lms.sch.tasks.boxstack.MxInTask;
|
||||
import org.nl.b_lms.sch.tasks.boxstack.MxMoveTask;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IBstIvtBoxinfoService;
|
||||
import org.nl.b_lms.storage_manage.database.service.IMdpbBoxtypeService;
|
||||
@@ -177,6 +180,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
@Autowired
|
||||
private MdPdStoragevehicleextMapper mdPdStoragevehicleextMapper;
|
||||
|
||||
@Autowired
|
||||
private MxInTask mxInTask;
|
||||
@Autowired
|
||||
private MxMoveTask mxMoveTask;
|
||||
|
||||
|
||||
/**
|
||||
* task_id:任务标识
|
||||
@@ -2006,4 +2014,66 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
log.info("acsRequestPoint输出参数为--------------------------:" + result.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@SneakyThrows
|
||||
@Override
|
||||
public Map<String, Object> secondaryAllocationPoint(String taskCode, String actionType) {
|
||||
String pointCode = "";
|
||||
String action = "";
|
||||
JSONObject result = new JSONObject();
|
||||
RLock lock = redissonClient.getLock(taskCode);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
if (tryLock) {
|
||||
SchBaseTask task = taskService.getOne(new LambdaQueryWrapper<SchBaseTask>().eq(SchBaseTask::getTask_code, taskCode));
|
||||
switch (actionType) {
|
||||
case "2":
|
||||
if (StrUtil.equals(task.getTask_type(), BoxStackEnum.TASK_TYPE.code("木箱出库"))) {
|
||||
|
||||
}
|
||||
// 取货分配
|
||||
//pointCode = getNewPoint(taskCode, actionType);
|
||||
result.put("data", pointCode);
|
||||
result.put("message", taskCode + "取放货分配成功,新点位为:" + pointCode);
|
||||
break;
|
||||
case "3":
|
||||
//放货二次分配
|
||||
if (StrUtil.equals(task.getTask_type(), BoxStackEnum.TASK_TYPE.code("木箱入库"))) {
|
||||
mxInTask.againPutPoint(taskCode);
|
||||
}
|
||||
case "4":
|
||||
if (StrUtil.equals(task.getTask_type(), BoxStackEnum.TASK_TYPE.code("木箱移库"))) {
|
||||
//判断起点是否还是等待点,如果是的话就是取货二次分配
|
||||
//否则判断终点是否还是等待点,如果是的话就是放货二次分配
|
||||
if (StrUtil.equals("","")){
|
||||
mxMoveTask.againGetPoint(taskCode);
|
||||
} else if (StrUtil.equals("","")){
|
||||
mxMoveTask.againPutPoint(taskCode);
|
||||
}
|
||||
}
|
||||
// 取货放货二次分配
|
||||
//updatePointStatus(taskCode, actionType);
|
||||
action = taskCode + "取放货完成!";
|
||||
result.put("data", action);
|
||||
result.put("message", taskCode + "取放货完成!");
|
||||
break;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
} else {
|
||||
log.info("一楼装箱区点位二次分配接口异常,正在分配中!");
|
||||
result.put("status", HttpStatus.BAD_REQUEST.value());
|
||||
result.put("message", "二次分配点位正在分配中,已锁住!");
|
||||
}
|
||||
} finally {
|
||||
if (lock.isLocked() && lock.isHeldByCurrentThread()) {
|
||||
lock.unlock();
|
||||
}
|
||||
}
|
||||
log.info("一楼装箱区点位二次分配" + taskCode + "---------------------------------------------" + result);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,235 @@
|
||||
server:
|
||||
port: 8013
|
||||
#配置数据源
|
||||
spring:
|
||||
shardingsphere:
|
||||
datasource:
|
||||
names: master,slave
|
||||
master:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 初始连接数
|
||||
initial-size: 20
|
||||
# 最小连接数
|
||||
min-idle: 30
|
||||
# 最大连接数
|
||||
max-active: 300
|
||||
# 是否自动回收超时连接
|
||||
socket-timeout: 10
|
||||
query-time-out: 7
|
||||
transaction-query-timeout: 30
|
||||
# 获取连接超时时间
|
||||
max-wait: 4000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: true
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
url: jdbc:mysql://localhost:3306/ynhl_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: password
|
||||
slave:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 初始连接数
|
||||
initial-size: 20
|
||||
# 最小连接数
|
||||
min-idle: 30
|
||||
# 最大连接数
|
||||
max-active: 300
|
||||
# 是否自动回收超时连接
|
||||
socket-timeout: 10
|
||||
query-time-out: 7
|
||||
transaction-query-timeout: 30
|
||||
# 获取连接超时时间
|
||||
max-wait: 4000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: true
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
url: jdbc:mysql://127.0.0.1:3306/ynhl_lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: password
|
||||
rules:
|
||||
readwrite-splitting:
|
||||
data-sources:
|
||||
db:
|
||||
type: Static
|
||||
props:
|
||||
#接口有事务,读写分离不生效,默认全部使用主库
|
||||
write-data-source-name: master
|
||||
read-data-source-names: slave
|
||||
#负载均衡算法名称
|
||||
load-balancer-name: round-robin
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:15}
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
redisson:
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
cache-enable: true
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
# 验证码
|
||||
login-code:
|
||||
# 验证码类型配置 查看 LoginProperties 类
|
||||
code-type: arithmetic
|
||||
# 登录图形验证码有效时间/分钟
|
||||
expiration: 2
|
||||
# 验证码高度
|
||||
width: 111
|
||||
# 验证码宽度
|
||||
heigth: 36
|
||||
# 内容长度
|
||||
length: 2
|
||||
# 字体名称,为空则使用默认字体
|
||||
font-name:
|
||||
# 字体大小
|
||||
font-size: 25
|
||||
|
||||
#jwt/api/esLog
|
||||
jwt:
|
||||
header: Authorization
|
||||
# 令牌前缀
|
||||
token-start-with: Bearer
|
||||
# 必须使用最少88位的Base64对该令牌进行编码
|
||||
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
|
||||
# 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
||||
token-validity-in-seconds: 14400000
|
||||
# 在线用户key
|
||||
online-key: online-token-
|
||||
# 验证码
|
||||
code-key: code-key-
|
||||
# token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
||||
detect: 1800000
|
||||
# 续期时间范围,默认1小时,单位毫秒
|
||||
renew: 3600000
|
||||
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
enabled: true
|
||||
|
||||
#是否开启 swagger-ui
|
||||
swagger:
|
||||
enabled: true
|
||||
|
||||
# IP 本地解析
|
||||
ip:
|
||||
local-parsing: true
|
||||
|
||||
# 文件存储路径
|
||||
file:
|
||||
mac:
|
||||
path: ~/file/
|
||||
avatar: ~/avatar/
|
||||
linux:
|
||||
path: /home/eladmin/file/
|
||||
avatar: /home/eladmin/avatar/
|
||||
windows:
|
||||
path: C:\eladmin\file\
|
||||
avatar: C:\eladmin\avatar\
|
||||
# 文件大小 /M
|
||||
maxSize: 100
|
||||
avatarMaxSize: 5
|
||||
logging:
|
||||
file:
|
||||
path: /Users/onepiece/logs/lms-logs
|
||||
config: classpath:logback-spring.xml
|
||||
|
||||
# Sa-Token配置
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: random-128
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix: Bearer
|
||||
|
||||
loki:
|
||||
url: http://localhost:3100/loki/api/v1
|
||||
systemName: lms
|
||||
es:
|
||||
index: lms_log
|
||||
lucene:
|
||||
index:
|
||||
path: D:\log\lms\lucene\index
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: prometheus
|
||||
base-path: /metrics
|
||||
metrics:
|
||||
prometheus:
|
||||
enabled: true
|
||||
enable:
|
||||
process: false
|
||||
integration: false
|
||||
uptime: false
|
||||
jdbc: false
|
||||
system: false
|
||||
jvm: false
|
||||
logback: false
|
||||
@@ -6,7 +6,7 @@ spring:
|
||||
freemarker:
|
||||
check-template-location: false
|
||||
profiles:
|
||||
active: dev
|
||||
active: localDev
|
||||
jackson:
|
||||
time-zone: GMT+8
|
||||
data:
|
||||
|
||||
@@ -128,6 +128,38 @@ https://juejin.cn/post/6844903775631572999
|
||||
</logger>
|
||||
</springProfile>
|
||||
|
||||
<springProfile name="localDev">
|
||||
<root level="info">
|
||||
<appender-ref ref="asyncLuceneAppender"/>
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
</root>
|
||||
<logger name="jdbc" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.springframework" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.hibernate" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.quartz" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="com.google" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.redisson" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.nl.modules.wql" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
<logger name="org.springframework.data" level="ERROR" additivity="true">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</logger>
|
||||
</springProfile>
|
||||
|
||||
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
<springProfile name="prod">
|
||||
|
||||
@@ -21,6 +21,16 @@
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱码">
|
||||
<el-input
|
||||
v-model="query.box_no"
|
||||
clearable
|
||||
placeholder="输入木箱码"
|
||||
style="width: 185px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱规格">
|
||||
<el-input
|
||||
v-model="query.box_spec"
|
||||
@@ -58,11 +68,11 @@
|
||||
@change="hand"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation :crud="crud"/>
|
||||
<rrOperation :crud="crud" />
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission"/>
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
@@ -74,10 +84,10 @@
|
||||
<br>
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
||||
<el-form-item label="堆叠位编码" prop="stack_code">
|
||||
<el-input v-model="form.stack_code" style="width: 300px;"/>
|
||||
<el-input v-model="form.stack_code" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="堆叠位名称" prop="stack_name">
|
||||
<el-input v-model="form.stack_name" style="width: 300px;"/>
|
||||
<el-input v-model="form.stack_name" style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="堆叠位区域" prop="point_status">
|
||||
<el-select
|
||||
@@ -98,30 +108,44 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="最大堆叠数" prop="max_layer_count">
|
||||
<el-input
|
||||
v-model.number="form.max_layer_count" style="width: 300px;"
|
||||
v-model.number="form.max_layer_count"
|
||||
style="width: 300px;"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '')"
|
||||
placeholder="请输入大于等于1的整数"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="当前堆叠数" prop="current_layer_count">
|
||||
<el-input disabled v-model="form.current_layer_count" style="width: 300px;"/>
|
||||
<el-input v-model="form.current_layer_count" disabled style="width: 300px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱规格" prop="box_spec">
|
||||
<el-input
|
||||
v-model="form.box_spec"
|
||||
style="width: 300px;"
|
||||
clearable
|
||||
@click.native="openMaterialDialog"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="木箱码" prop="box_no">
|
||||
<el-input v-model="form.box_no" style="width: 300px;" @blur="handleBoxNoBlur(form.box_no)" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排" prop="x">
|
||||
<el-input
|
||||
v-model.number="form.x" style="width: 300px;"
|
||||
v-model.number="form.x"
|
||||
style="width: 300px;"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '')"
|
||||
placeholder="请输入大于等于1的整数"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="列" prop="y">
|
||||
<el-input
|
||||
v-model.number="form.y" style="width: 300px;"
|
||||
v-model.number="form.y"
|
||||
style="width: 300px;"
|
||||
oninput="this.value = this.value.replace(/[^0-9]/g, '')"
|
||||
placeholder="请输入大于等于1的整数"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否启用" prop="is_used">
|
||||
<el-switch v-model="form.is_used" active-value="1" inactive-value="0"/>
|
||||
<el-switch v-model="form.is_used" active-value="1" inactive-value="0" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@@ -139,33 +163,34 @@
|
||||
style="width: 100%;"
|
||||
@selection-change="crud.selectionChangeHandler"
|
||||
>
|
||||
<el-table-column type="selection" width="55"/>
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="stack_code" label="堆叠位编码" width="100px">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.stack_code }}</el-link>
|
||||
</template>
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-link type="warning" @click="toView(scope.row)">{{ scope.row.stack_code }}</el-link>-->
|
||||
<!-- </template>-->
|
||||
</el-table-column>
|
||||
<el-table-column prop="stack_name" label="堆叠位名称" width="140px"/>
|
||||
<el-table-column prop="stack_name" label="堆叠位名称" width="140px" />
|
||||
<el-table-column prop="point_status" label="区域类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.boxinfo_area[scope.row.point_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="current_layer_count" label="当前堆叠数" width="140px"/>
|
||||
<el-table-column prop="max_layer_count" label="最大堆叠数" width="100px"/>
|
||||
<el-table-column prop="box_spec" label="木箱规格" show-overflow-tooltip width="150px"/>
|
||||
<el-table-column prop="box_spec_name" label="木箱规格名称" show-overflow-tooltip width="200px"/>
|
||||
<el-table-column prop="x" label="排" width="100px"/>
|
||||
<el-table-column prop="y" label="列" width="100px"/>
|
||||
<el-table-column prop="current_layer_count" label="当前堆叠数" width="140px" />
|
||||
<el-table-column prop="max_layer_count" label="最大堆叠数" width="100px" />
|
||||
<el-table-column prop="box_spec" label="木箱规格" show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="box_spec_name" label="木箱规格名称" show-overflow-tooltip width="200px" />
|
||||
<el-table-column prop="box_no" label="木箱号" show-overflow-tooltip width="150px" />
|
||||
<el-table-column prop="x" label="排" width="100px" />
|
||||
<el-table-column prop="y" label="列" width="100px" />
|
||||
<el-table-column prop="is_used" label="是否启用">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.is_used[scope.row.is_used] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="created_name" label="创建人" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="created_time" label="创建时间" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="update_name" label="修改人" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="created_name" label="创建人" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="created_time" label="创建时间" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="update_name" label="修改人" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="150" show-overflow-tooltip />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -177,7 +202,7 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination/>
|
||||
<pagination />
|
||||
</div>
|
||||
<mater-dialog
|
||||
:key="materialDialogKey"
|
||||
@@ -187,13 +212,13 @@
|
||||
mater-opt-code="木箱"
|
||||
@handleSetMaterialValue="handleSetMaterialValue"
|
||||
/>
|
||||
<LayerViewDialog ref="boxStackLayerView" @editChanged="crud.toQuery()"/>
|
||||
<!-- <LayerViewDialog ref="boxStackLayerView" @editChanged="crud.toQuery()"/>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudBoxStack from './boxstack'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
@@ -201,7 +226,6 @@ import pagination from '@crud/Pagination'
|
||||
import MaterDialog from './MaterDialog'
|
||||
import LayerViewDialog from './LayerViewDialog'
|
||||
|
||||
|
||||
const defaultForm = {
|
||||
stack_id: null,
|
||||
stack_code: null,
|
||||
@@ -210,7 +234,8 @@ const defaultForm = {
|
||||
max_layer_count: 3,
|
||||
point_status: null,
|
||||
box_spec: null,
|
||||
is_used: "1",
|
||||
box_no: null,
|
||||
is_used: '1',
|
||||
x: null,
|
||||
y: null,
|
||||
create_id: null,
|
||||
@@ -223,7 +248,7 @@ const defaultForm = {
|
||||
|
||||
export default {
|
||||
name: 'Boxstack',
|
||||
components: {pagination, crudOperation, rrOperation, udOperation, MaterDialog, LayerViewDialog},
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, MaterDialog, LayerViewDialog },
|
||||
dicts: ['boxinfo_area', 'is_used'],
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
@@ -232,7 +257,7 @@ export default {
|
||||
url: 'api/bstIvtboxstack',
|
||||
idField: 'stack_id',
|
||||
sort: 'stack_id,desc',
|
||||
crudMethod: {...crudBoxStack},
|
||||
crudMethod: { ...crudBoxStack },
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: true,
|
||||
@@ -249,28 +274,28 @@ export default {
|
||||
materialDialogKey: 0,
|
||||
rules: {
|
||||
stack_code: [
|
||||
{required: true, message: '堆叠位编码不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '堆叠位编码不能为空', trigger: 'blur' }
|
||||
],
|
||||
stack_name: [
|
||||
{required: true, message: '堆叠位名称不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '堆叠位名称不能为空', trigger: 'blur' }
|
||||
],
|
||||
current_layer_count: [
|
||||
{required: true, message: '当前堆叠数不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '当前堆叠数不能为空', trigger: 'blur' }
|
||||
],
|
||||
max_layer_count: [
|
||||
{required: true, message: '最大堆叠数不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '最大堆叠数不能为空', trigger: 'blur' }
|
||||
],
|
||||
point_status: [
|
||||
{required: true, message: '区域不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '区域不能为空', trigger: 'blur' }
|
||||
],
|
||||
x: [
|
||||
{required: true, message: '木箱排不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '木箱排不能为空', trigger: 'blur' }
|
||||
],
|
||||
y: [
|
||||
{required: true, message: '木箱列不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '木箱列不能为空', trigger: 'blur' }
|
||||
],
|
||||
is_used: [
|
||||
{required: true, message: '是否启用不能为空', trigger: 'blur'}
|
||||
{ required: true, message: '是否启用不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -280,6 +305,15 @@ export default {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
},
|
||||
handleBoxNoBlur(value) {
|
||||
console.log(value)
|
||||
if (!value || value.trim() === '') {
|
||||
this.form.current_layer_count = 0
|
||||
} else {
|
||||
const boxNoArray = value.split(',')
|
||||
this.form.current_layer_count = boxNoArray.length
|
||||
}
|
||||
},
|
||||
toView(row) {
|
||||
if (row !== null) {
|
||||
this.$refs.boxStackLayerView.setForm(row)
|
||||
@@ -288,25 +322,25 @@ export default {
|
||||
openMaterialDialog() {
|
||||
if (this.crud.status.edit > 0) return // 如果是编辑状态,则不允许重新选择
|
||||
this.dialogMaterialVisible = true
|
||||
this.materialDialogKey += 1;
|
||||
this.materialDialogKey += 1
|
||||
},
|
||||
handleSetMaterialValue(material) {
|
||||
this.form.box_spec = material.material_code
|
||||
this.dialogMaterialVisible = false
|
||||
},
|
||||
rowStyle({row, index}) {
|
||||
let backgroun = {}
|
||||
rowStyle({ row, index }) {
|
||||
const backgroun = {}
|
||||
if (row.container_name != null && row.update_time != null && row.update_time != undefined) {
|
||||
let now = new Date()
|
||||
let before = new Date(row.update_time)
|
||||
const diff = now.getTime() - before.getTime();
|
||||
let min = Math.floor(diff / (1000 * 60))
|
||||
const now = new Date()
|
||||
const before = new Date(row.update_time)
|
||||
const diff = now.getTime() - before.getTime()
|
||||
const min = Math.floor(diff / (1000 * 60))
|
||||
console.log(min)
|
||||
if (min > 120) {
|
||||
backgroun.background = 'red';
|
||||
backgroun.background = 'red'
|
||||
}
|
||||
}
|
||||
return backgroun;
|
||||
return backgroun
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
|
||||
Reference in New Issue
Block a user