rev: 成品出库修改发货区功能
This commit is contained in:
@@ -29,6 +29,7 @@ public class ProductOutTask extends AbstractAcsTask {
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
|
||||
String task_id = taskObj.getString("task_id");
|
||||
JSONObject jsonTask = taskTab.query("task_id = '" + task_id + "' and task_status < '7'").uniqueResult(0);
|
||||
@@ -52,6 +53,11 @@ public class ProductOutTask extends AbstractAcsTask {
|
||||
|
||||
disTab.update(map,"task_id = '"+task_id+"'");
|
||||
|
||||
// 解锁终点点位
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.getString("point_code2") + "'").uniqueResult(0);
|
||||
jsonPoint.put("lock_type", "1");
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
|
||||
@@ -709,7 +709,6 @@ public class ProductOutServiceImpl implements ProductOutService {
|
||||
//出库主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||
|
||||
String point_code = whereJson.getString("point_code"); // 终点
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
String iostorinvdtl_id = whereJson.getString("iostorinvdtl_id");
|
||||
|
||||
@@ -719,13 +718,8 @@ public class ProductOutServiceImpl implements ProductOutService {
|
||||
throw new BadRequestException("未查到相关出库单");
|
||||
}
|
||||
|
||||
JSONObject jsonPoint2 = wo_Point.query("lock_type='1' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0);
|
||||
//如果终点站点被锁定或者有载具号,则不允许设置点位
|
||||
if (ObjectUtil.isEmpty(jsonPoint2)) {
|
||||
throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!");
|
||||
}
|
||||
|
||||
// 查询此明细的所有未生成的分配明细(根据片区、排 分组)
|
||||
// 查询此明细的所有未生成的分配明细
|
||||
JSONArray allArr = WQL.getWO("QST_IVT_PRODUCTOUTDIV_01")
|
||||
.addParam("flag", "5")
|
||||
.addParam("iostorinvdtl_id", iostorinvdtl_id)
|
||||
@@ -738,20 +732,27 @@ public class ProductOutServiceImpl implements ProductOutService {
|
||||
for (int i = 0; i < allArr.size(); i++) {
|
||||
JSONObject jsonDis = allArr.getJSONObject(i);
|
||||
|
||||
// 找发货区点位
|
||||
JSONObject jsonSendOut = this.findSendOut();
|
||||
|
||||
// 创建任务
|
||||
JSONObject jsonTask = new JSONObject();
|
||||
jsonTask.put("task_type", "010502");
|
||||
jsonTask.put("point_code1", jsonDis.getString("struct_code"));
|
||||
jsonTask.put("point_code2", point_code);
|
||||
jsonTask.put("point_code2", jsonSendOut.getString("point_code"));
|
||||
jsonTask.put("vehicle_code", jsonDis.getString("storagevehicle_code"));
|
||||
jsonTask.put("product_area", jo_mst.getString("product_code"));
|
||||
|
||||
ProductOutTask task = new ProductOutTask();
|
||||
String task_id = task.createTask(jsonTask);
|
||||
|
||||
// 锁定终点
|
||||
jsonSendOut.put("lock_type","3");
|
||||
wo_Point.update(jsonSendOut);
|
||||
|
||||
// 修改明细状态
|
||||
jsonDis.put("work_status", "01");
|
||||
jsonDis.put("point_id", jsonPoint2.getString("point_id"));
|
||||
jsonDis.put("point_id", jsonSendOut.getString("point_id"));
|
||||
jsonDis.put("task_id", task_id);
|
||||
wo_dis.update(jsonDis);
|
||||
}
|
||||
@@ -1056,6 +1057,13 @@ public class ProductOutServiceImpl implements ProductOutService {
|
||||
from_start.put("vehicle_code", "");
|
||||
pointTab.update(from_start,"vehicle_code = '"+dis.getString("storagevehicle_code")+"'");
|
||||
|
||||
// 解锁终点增加库存
|
||||
JSONObject jsonPoint = pointTab.query("point_id = '" + dis.getString("point_id") + "'").uniqueResult(0);
|
||||
jsonPoint.put("lock_type", "1");
|
||||
jsonPoint.put("point_status", "2");
|
||||
jsonPoint.put("vehicle_code", dis.getString("storagevehicle_code"));
|
||||
pointTab.update(jsonPoint);
|
||||
|
||||
// 更新分配明细执行状态为 - 99
|
||||
JSONObject jsonDis = wo_dis.query("iostorinvdis_id = '" + dis.getString("iostorinvdis_id") + "'").uniqueResult(0);
|
||||
jsonDis.put("work_status", "99");
|
||||
@@ -1464,4 +1472,17 @@ public class ProductOutServiceImpl implements ProductOutService {
|
||||
wo_mst.update(jo_mst);
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public JSONObject findSendOut() {
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject jsonPoint = pointTab.query("point_status = '1' and region_code = 'FH01' and lock_type = '1' and is_delete = '0' and is_used = '1' and IFNULL(vehicle_code,'') = '' order by point_code").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) {
|
||||
throw new BadRequestException("发货区无可用点位");
|
||||
}
|
||||
|
||||
return jsonPoint;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@
|
||||
disabled
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出库点" prop="point_code">
|
||||
<!-- <el-form-item label="出库点" prop="point_code">
|
||||
<el-select
|
||||
v-model="form2.point_code"
|
||||
clearable
|
||||
@@ -165,7 +165,7 @@
|
||||
:value="item.point_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item>-->
|
||||
</el-form>
|
||||
</div>
|
||||
<span class="crud-opts-right2">
|
||||
@@ -492,10 +492,10 @@ export default {
|
||||
}
|
||||
},
|
||||
allSetPoint() {
|
||||
if (this.form2.point_code === '') {
|
||||
/* if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
}*/
|
||||
if (this.currentRow === '') {
|
||||
this.crud.notify('请选择明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
@@ -511,10 +511,10 @@ export default {
|
||||
})
|
||||
},
|
||||
allSetPointAllDtl() {
|
||||
if (this.form2.point_code === '') {
|
||||
/* if (this.form2.point_code === '') {
|
||||
this.crud.notify('请先选择站点!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
}*/
|
||||
this.loadingSetAllPoint = true
|
||||
const data = {
|
||||
'point_code': this.form2.point_code,
|
||||
|
||||
@@ -151,8 +151,6 @@
|
||||
|
||||
import { crud } from '@crud/crud'
|
||||
import productOut from '@/views/wms/st/productOut/productout'
|
||||
// import crudStorattr from '@/views/wms/basedata/st/stor/storattr'
|
||||
// import crudRawAssist from '@/views/wms/st/inbill/rawassist'
|
||||
import crudProductIn from '@/views/wms/st/productIn/productin'
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user