rev:成品出库分配设置站点需改为 生成任务和下发任务一起
This commit is contained in:
@@ -12,7 +12,9 @@ import java.util.Map;
|
|||||||
@Getter
|
@Getter
|
||||||
public enum PDAEnum {
|
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")),
|
SECT_CODE(MapOf.of("半成品库区", "KQ005")),
|
||||||
//库区id
|
//库区id
|
||||||
|
|||||||
@@ -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.ISchBaseTaskService;
|
||||||
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
import org.nl.wms.scheduler_manage.service.task.dao.SchBaseTask;
|
||||||
import org.nl.wms.storage_manage.IOSEnum;
|
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.IStIvtIostorinvCpOutService;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisCpService;
|
||||||
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
|
import org.nl.wms.storage_manage.productmanage.service.iostorInv.IStIvtIostorinvdisdtlCpService;
|
||||||
@@ -397,8 +398,10 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void setPoint(JSONObject whereJson) {
|
public void setPoint(JSONObject whereJson) {
|
||||||
/*
|
/*
|
||||||
* 1.生成任务
|
* 1.分配出库点
|
||||||
* 2.更新分配状态
|
* 2.生成任务
|
||||||
|
* 3.下发任务
|
||||||
|
* 4.更新分配状态
|
||||||
*/
|
*/
|
||||||
// 1.校验是否设置过起点
|
// 1.校验是否设置过起点
|
||||||
StIvtIostorinvdisCp disDao = iostorinvdisCpService.getById(whereJson.getString("iostorinvdis_id"));
|
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("未生成"))
|
.ne(StIvtIostorinvdisCp::getWork_status, IOSEnum.WORK_STATUS.code("未生成"))
|
||||||
, false
|
, false
|
||||||
);
|
);
|
||||||
SchBasePoint pointDao;
|
SchBasePoint pointDao = null;
|
||||||
if (ObjectUtil.isNotEmpty(disIsnull)) {
|
if (ObjectUtil.isNotEmpty(disIsnull)) {
|
||||||
disDao.setTask_id(disIsnull.getTask_id());
|
disDao.setTask_id(disIsnull.getTask_id());
|
||||||
pointDao = new SchBasePoint();
|
pointDao = new SchBasePoint();
|
||||||
@@ -420,11 +423,46 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
pointDao.setPoint_code(disDao.getPoint_code());
|
pointDao.setPoint_code(disDao.getPoint_code());
|
||||||
pointDao.setPoint_name(disDao.getPoint_name());
|
pointDao.setPoint_name(disDao.getPoint_name());
|
||||||
}else {
|
}else {
|
||||||
// 2.下发任务
|
|
||||||
pointDao = iSchBasePointService.getOne(
|
// 2.1 判断出库点是否为空,为空则分配一个出库点
|
||||||
new QueryWrapper<SchBasePoint>().lambda()
|
String point_code = whereJson.getString("point_code");
|
||||||
.eq(SchBasePoint::getPoint_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()
|
PointEvent event = PointEvent.builder()
|
||||||
.type(AcsTaskEnum.TASK_STRUCT_CP_OUT)
|
.type(AcsTaskEnum.TASK_STRUCT_CP_OUT)
|
||||||
.acs_task_type("8")
|
.acs_task_type("8")
|
||||||
@@ -436,6 +474,11 @@ public class StIvtIostorinvCpOutServiceImpl extends ServiceImpl<StIvtIostorinvCp
|
|||||||
.callback((Consumer<String>) disDao::setTask_id)
|
.callback((Consumer<String>) disDao::setTask_id)
|
||||||
.build();
|
.build();
|
||||||
BussEventMulticaster.Publish(event);
|
BussEventMulticaster.Publish(event);
|
||||||
|
|
||||||
|
// 2.3 下发任务
|
||||||
|
whereJson.put("task_id", disDao.getTask_id());
|
||||||
|
sendTask(whereJson);
|
||||||
|
|
||||||
}
|
}
|
||||||
// 3.更新分配表
|
// 3.更新分配表
|
||||||
iostorinvdisCpService.update(
|
iostorinvdisCpService.update(
|
||||||
|
|||||||
@@ -279,10 +279,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
setMaterValue(row) {
|
setMaterValue(row) {
|
||||||
this.materialForm.material_id = row.material_id
|
this.$set(this.materialForm, 'material_id', row.material_id)
|
||||||
this.materialForm.material_code = row.material_code
|
this.$set(this.materialForm, 'material_code', row.material_code)
|
||||||
this.materialForm.material_name = row.material_name
|
this.$set(this.materialForm, 'material_name', row.material_name)
|
||||||
this.materialForm.material_spec = row.material_spec
|
this.$set(this.materialForm, 'material_spec', row.material_spec)
|
||||||
if (row.material_spec != null || row.material_spec != '') {
|
if (row.material_spec != null || row.material_spec != '') {
|
||||||
this.materialForm.point_status = '2'
|
this.materialForm.point_status = '2'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -448,11 +448,10 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
setPoint() {
|
setPoint() {
|
||||||
if (this.form2.point_code === '') {
|
/* if (this.form2.point_code === '') {
|
||||||
this.crud.notify('请选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return false
|
return false
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (this.currentDis.iostorinvdis_id === undefined) {
|
if (this.currentDis.iostorinvdis_id === undefined) {
|
||||||
this.crud.notify('请选择分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
this.crud.notify('请选择分配明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user