fix:木箱出库时存在移库任务将出库锁释放
This commit is contained in:
@@ -32,7 +32,7 @@ import java.util.stream.Collectors;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class AutoSendVehicleToKzj {
|
public class AutoSendVehicleToKzj extends Prun{
|
||||||
|
|
||||||
private final String THIS_CLASS = AutoSendVehicleToKzj.class.getName();
|
private final String THIS_CLASS = AutoSendVehicleToKzj.class.getName();
|
||||||
@Resource
|
@Resource
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import cn.hutool.core.util.ObjectUtil;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
|
import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
|
||||||
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
import org.nl.b_lms.sch.task.dao.SchBaseTask;
|
||||||
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
|
||||||
import org.nl.b_lms.sch.tasks.TwoExcepionalMoveTask;
|
import org.nl.b_lms.sch.tasks.TwoExcepionalMoveTask;
|
||||||
@@ -56,7 +58,7 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
|||||||
* 木箱信息服务
|
* 木箱信息服务
|
||||||
*/
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBstIvtBoxinfoService iBstIvtBoxinfoService;
|
private IpdmBiSubpackagerelationService ipdmBiSubpackagerelationService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 任务服务
|
* 任务服务
|
||||||
@@ -161,47 +163,14 @@ public class OutBoxManageServiceImpl implements OutBoxManageService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
JSONObject jsonBox;
|
JSONObject jsonBox = null;
|
||||||
if (structArray.size() < 4){
|
for (int i = 0; i < structArray.size(); i++) {
|
||||||
jsonBox = structArray.getJSONObject(0);
|
JSONObject jsonObject = structArray.getJSONObject(i);
|
||||||
}else
|
int count = ipdmBiSubpackagerelationService.count(new QueryWrapper<PdmBiSubpackagerelation>()
|
||||||
{
|
.eq("package_box_sn", jsonObject.getString("storagevehicle_code")));
|
||||||
//大于一个的话则走查找逻辑
|
if (count == 0){
|
||||||
// 确定巷道:找相同规格木箱的最多的巷道
|
jsonBox = jsonObject;
|
||||||
if (ObjectUtil.isEmpty(block_num)) {
|
break;
|
||||||
block_num = getMaxBlock(whereJson);
|
|
||||||
}
|
|
||||||
// 确定排:找某一巷道规格木箱的最多排
|
|
||||||
whereJson.put("block_num", block_num);
|
|
||||||
String row_num = getMaxRow(whereJson);
|
|
||||||
// 确定仓位
|
|
||||||
whereJson.put("row_num", row_num);
|
|
||||||
whereJson.put("notMove",true);
|
|
||||||
jsonBox = getBox(whereJson);
|
|
||||||
// 为空则新找巷道
|
|
||||||
if (ObjectUtil.isEmpty(jsonBox)) {
|
|
||||||
whereJson.put("flag", "1");
|
|
||||||
notOutBlockList.add(whereJson.getString("block_num"));
|
|
||||||
String join = "('" + String.join("','", notOutBlockList) + "')";
|
|
||||||
whereJson.put("not_block_id", join);
|
|
||||||
List<JSONObject> blockList = WQL.getWO("BST_OUTBOX").addParamMap(whereJson)
|
|
||||||
.process().getResultJSONArray(0).toJavaList(JSONObject.class);
|
|
||||||
for (int i = 0; i < blockList.size(); i++) {
|
|
||||||
JSONObject json = blockList.get(i);
|
|
||||||
json.put("stor_id", whereJson.getString("stor_id"));
|
|
||||||
json.put("sect_id", whereJson.getString("sect_id"));
|
|
||||||
json.put("box_length", whereJson.getString("box_length"));
|
|
||||||
json.put("box_width", whereJson.getString("box_width"));
|
|
||||||
json.put("box_high", whereJson.getString("box_high"));
|
|
||||||
json.put("num", whereJson.getString("num"));
|
|
||||||
String row_num_2 = getMaxRow(json);
|
|
||||||
json.put("row_num", row_num_2);
|
|
||||||
JSONObject jsonAttr_2 = getBox(json);
|
|
||||||
if (ObjectUtil.isNotEmpty(jsonAttr_2)) {
|
|
||||||
jsonBox = jsonAttr_2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ spring:
|
|||||||
url-pattern: /druid/*
|
url-pattern: /druid/*
|
||||||
reset-enable: false
|
reset-enable: false
|
||||||
filters:
|
filters:
|
||||||
DruidFilter,stat
|
`DruidFilter`,stat
|
||||||
url: jdbc:mysql://10.1.3.87:3306/lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
url: jdbc:mysql://10.1.3.87:3306/lms?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
|
||||||
username: root
|
username: root
|
||||||
password: NLABC&hl123
|
password: NLABC&hl123
|
||||||
|
|||||||
Reference in New Issue
Block a user