rev:成品出库分配设置站点需改为 生成任务和下发任务一起

This commit is contained in:
2023-08-10 10:45:47 +08:00
parent 59f002b063
commit 93fa9f818f
4 changed files with 60 additions and 16 deletions

View File

@@ -12,7 +12,9 @@ import java.util.Map;
@Getter
public enum PDAEnum {
//点位区域
REGION_CODE(MapOf.of("半成品入库区域", "A1_BCPRK01", "半成品出库区域", "A1_BCPCK01","成品入库区域", "A1_CPRK01","半成品盘点区域", "A1_BCP_PP","海柔半成品出库区域","A3_BCPCK01")),
REGION_CODE(MapOf.of("半成品入库区域", "A1_BCPRK01", "半成品出库区域", "A1_BCPCK01","成品入库区域",
"A1_CPRK01","半成品盘点区域", "A1_BCP_PP","海柔半成品出库区域","A3_BCPCK01",
"发货区域","A1_FH01")),
//库区编码
SECT_CODE(MapOf.of("半成品库区", "KQ005")),
//库区id

View File

@@ -40,6 +40,7 @@ import org.nl.wms.scheduler_manage.service.point.dao.SchBasePoint;
import org.nl.wms.scheduler_manage.service.task.ISchBaseTaskService;
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
import org.nl.wms.storage_manage.IOSEnum;
import org.nl.wms.storage_manage.pda.PDAEnum;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvCpOutService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
@@ -397,8 +398,10 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
@Transactional(rollbackFor = Exception.class)
public void setPoint(JSONObject whereJson) {
/*
* 1.生成任务
* 2.更新分配状态
* 1.分配出库点
* 2.生成任务
* 3.下发任务
* 4.更新分配状态
*/
// 1.校验是否设置过起点
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getById(whereJson.getString("iostorinvdis_id"));
@@ -412,7 +415,7 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.ne(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("未生成"))
, false
);
SchBasePoint pointDao;
SchBasePoint pointDao = null;
if (ObjectUtil.isNotEmpty(disIsnull)) {
disDao.setTask_id(disIsnull.getTask_id());
pointDao = new SchBasePoint();
@@ -420,11 +423,46 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
pointDao.setPoint_code(disDao.getPoint_code());
pointDao.setPoint_name(disDao.getPoint_name());
}else {
// 2.下发任务
pointDao = iSchBasePointService.getOne(
new QueryWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getPoint_code, whereJson.getString("point_code"))
);
// 2.1 判断出库点是否为空,为空则分配一个出库点
String point_code = whereJson.getString("point_code");
if (ObjectUtil.isNotEmpty(point_code)) {
pointDao = iSchBasePointService.getOne(
new QueryWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getPoint_code, point_code)
);
} else {
// 分配一个出库点
List<SchBasePoint> pointList = iSchBasePointService.list(
new QueryWrapper<SchBasePoint>().lambda()
.eq(SchBasePoint::getIs_delete, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getIs_used, IOSEnum.IS_USED.code(""))
.eq(SchBasePoint::getRegion_code, PDAEnum.REGION_CODE.code("发货区域"))
.orderByAsc(SchBasePoint::getPoint_code)
);
for (SchBasePoint dao : pointList) {
// 校验此点位是否有未完成的任务
SchBaseTask taskDao = iSchBaseTaskService.getOne(
new QueryWrapper<SchBaseTask>().lambda()
.eq(SchBaseTask::getPoint_code3, dao.getPoint_code())
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_USED.code(""))
.notIn(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode(), TaskStatusEnum.CANCEL.getCode())
, false
);
if (ObjectUtil.isEmpty(taskDao)) {
pointDao = dao;
break;
}
}
if (ObjectUtil.isEmpty(pointDao)) throw new BadRequestException("出库点位为空,请检查!");
}
// 2.2 生成任务
PointEvent event = PointEvent.builder()
.type(AcsTaskEnum.TASK_STRUCT_CP_OUT)
.acs_task_type("8")
@@ -436,6 +474,11 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
.callback((Consumer<String>) disDao::setTask_id)
.build();
BussEventMulticaster.Publish(event);
// 2.3 下发任务
whereJson.put("task_id", disDao.getTask_id());
sendTask(whereJson);
}
// 3.更新分配表
iostorinvdisCpService.update(

View File

@@ -279,10 +279,10 @@ export default {
})
},
setMaterValue(row) {
this.materialForm.material_id = row.material_id
this.materialForm.material_code = row.material_code
this.materialForm.material_name = row.material_name
this.materialForm.material_spec = row.material_spec
this.$set(this.materialForm, 'material_id', row.material_id)
this.$set(this.materialForm, 'material_code', row.material_code)
this.$set(this.materialForm, 'material_name', row.material_name)
this.$set(this.materialForm, 'material_spec', row.material_spec)
if (row.material_spec != null || row.material_spec != '') {
this.materialForm.point_status = '2'
}

View File

@@ -448,11 +448,10 @@ export default {
})
},
setPoint() {
if (this.form2.point_code === '') {
/* if (this.form2.point_code === '') {
this.crud.notify('请选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
return false
}
}*/
if (this.currentDis.iostorinvdis_id === undefined) {
this.crud.notify('请选择分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
return false