同一天相同物料才能放在同一排

This commit is contained in:
psh
2024-07-02 09:55:46 +08:00
parent 4a7bf4d5f1
commit f5525f2129
6 changed files with 8 additions and 4 deletions

View File

@@ -113,6 +113,7 @@ public class GHCMLTask extends AbstractTask {
String requestParam = task.getRequest_param();
JSONObject jsonObject = JSONObject.parseObject(requestParam);
jsonObject.put("material_id", ObjectUtil.isNotEmpty(groupInfo) ? groupInfo.getMaterial_id() : null);
jsonObject.put("pcsn",ObjectUtil.isNotEmpty(groupInfo) ? groupInfo.getPcsn() : null);
SchBasePoint point = findNextPoint(nextRegionStr, jsonObject);
log.info("当前任务{}找到预计终点{}",task.getTask_id(),point.getPoint_code());
if (ObjectUtil.isEmpty(point)) {
@@ -142,9 +143,10 @@ public class GHCMLTask extends AbstractTask {
*/
private SchBasePoint findNextPoint(List<String> nextRegionStr, JSONObject jsonObject) {
// 查找是否有相同物料的货位:
// 查找相同批次
// 最小排最小列且列大于1即不是等待位置1不写死使用子查询寻找当排最小列序号的值
// 多个数据选择一个Limit 1, 还需要考虑任务数,尽量一排排满
SchBasePoint sameMaterialPoints = autoMapper.getZCSameMaterialPoint(nextRegionStr.get(0)
SchBasePoint sameMaterialPoints = autoMapper.getZCSameMaterialPoint(jsonObject.getString("pcsn")
, jsonObject.getString("material_id"));
if (ObjectUtil.isNotEmpty(sameMaterialPoints)) {
// 找到相同物料。分配等待点。

View File

@@ -15,7 +15,7 @@ public interface AutoMapper {
List<SchBasePoint> getGHSExitMaterialList();
SchBasePoint getZCSameMaterialPoint(String regionCode, String materialId);
SchBasePoint getZCSameMaterialPoint(String pcsn, String materialId);
SchBasePoint getZCEmptyMaterialPoint(String regionCode, String materialId);

View File

@@ -37,6 +37,7 @@
AND vg.group_bind_material_status = '2'
WHERE p.region_code = 'ZC'
and vg.material_id=#{materialId}
and RIGHT(vg.pcsn,8)=RIGHT(#{pcsn},8)
)
ORDER BY p.row_num, p.col_num
limit 1

View File

@@ -314,7 +314,7 @@ public class TBXMLTask extends AbstractTask {
StringBuilder pcsn = new StringBuilder();
pcsn.append(orderObject.getPoint_code())
.append(orderObject.getMaterial_code())
.append(orderObject.getTeam())
.append(ObjectUtil.isEmpty(orderObject.getTeam())?0:orderObject.getTeam())
.append(DateUtil.format(DateUtil.date(), "yyyyMMdd"));
groupEntity.setPcsn(pcsn.toString());
groupEntity.setInstorage_time(DateUtil.now());

View File

@@ -135,6 +135,7 @@ public class TBXQKTask extends AbstractTask {
.and(la -> la.isNull(SchBasePoint::getIng_task_code)
.or()
.eq(SchBasePoint::getIng_task_code, ""))
.eq(SchBasePoint::getPoint_status,"2")
.eq(SchBasePoint::getBlock_num, "1")
.eq(SchBasePoint::getIs_used, true);
List<SchBasePoint> schBasePoints = pointService.list(lam);

View File

@@ -2,7 +2,7 @@ spring:
freemarker:
check-template-location: false
profiles:
active: dev
active: prod
jackson:
time-zone: GMT+8
data: