opt:优化补空载具优先级

This commit is contained in:
2024-07-31 15:21:45 +08:00
parent 2cc00c2c06
commit 3de0fdbaf8
3 changed files with 11 additions and 7 deletions

View File

@@ -54,7 +54,7 @@
FROM FROM
pdm_bi_subpackagerelation pdm_bi_subpackagerelation
WHERE WHERE
container_name IN (SELECT container_name FROM bst_ivt_packageinfoivt WHERE point_status = '3' AND ivt_status = '3') container_name IN (SELECT container_name FROM bst_ivt_packageinfoivt WHERE point_status = '3' AND ivt_status = '3' AND is_used ='1' )
<if test="sale_order_name != null and sale_order_name != ''"> <if test="sale_order_name != null and sale_order_name != ''">
AND sale_order_name LIKE CONCAT('%', #{sale_order_name}, '%') AND sale_order_name LIKE CONCAT('%', #{sale_order_name}, '%')
</if> </if>

View File

@@ -193,7 +193,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList; List<PdmBiSubpackagerelation> pdmBiSubpackagerelationList;
//请求来源 //请求来源
if (!whereJson.containsKey("type")) { if (!whereJson.containsKey("type")) {
return Collections.emptyList(); whereJson.put("type", PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"));
} }
if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) { if (whereJson.get("type").toString().equals(PackageInfoIvtEnum.REQUEST_SOURCE.code("PC"))) {
//订单号 //订单号
@@ -273,7 +273,7 @@ public class PdmBiSubpackagerelationServiceImpl extends ServiceImpl<PdmBiSubpack
//检查是否存在已分配规格的子卷号 //检查是否存在已分配规格的子卷号
List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> r.getStatus().equals("0")).collect(Collectors.toList()); List<PdmBiSubpackagerelation> isOutBox = packagerelationList.stream().filter(r -> r.getStatus().equals("0")).collect(Collectors.toList());
if (isOutBox.size() > 0) { if (isOutBox.size() > 0) {
throw new BadRequestException("标记为黄色的子卷号已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷"); throw new BadRequestException("标记为黄色的子卷号已分配且对应的木箱已出库,请重新选择未分配木箱规格的子卷");
} }
JSONArray jsonArray = whereJson.getJSONArray("tableMater"); JSONArray jsonArray = whereJson.getJSONArray("tableMater");
if (jsonArray == null || jsonArray.size() == 0) { if (jsonArray == null || jsonArray.size() == 0) {

View File

@@ -7,7 +7,6 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt; import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.dao.mapper.BstIvtPackageinfoivtMapper;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService; import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService;
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;
@@ -110,11 +109,16 @@ public class AutoSendVehicleToKzj {
} else { } else {
return; return;
} }
if (existTask.size() % 2 != 0) { List<BstIvtPackageinfoivt> packageinfoivtList = packageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("空载具缓存位"), PackageInfoIvtEnum.IVT_STATUS.code(""), null);
//优先去待检区 if (packageinfoivtList.size() == 1) {
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)")); pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
} else { } else {
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)")); if (existTask.size() % 2 != 0) {
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(管制区->空载具缓存位)"));
} else {
//优先去待检区
pointCode1 = getPointCode(task, PackageInfoIvtEnum.TASK_TYPE.code("补空(待检区->空载具缓存位)"));
}
} }
//去待检区或管制区搬运空载具 //去待检区或管制区搬运空载具
if (pointCode1 != null) { if (pointCode1 != null) {