This commit is contained in:
2022-10-27 18:57:34 +08:00
9 changed files with 106 additions and 82 deletions

View File

@@ -96,11 +96,9 @@
IF 输入.flag = "3"
PAGEQUERY
SELECT
point.*,
region.region_name
point.*
FROM
sch_base_point point
LEFT JOIN sch_base_region region ON point.region_id = region.region_id
WHERE
point.lock_type = '00'
AND point.is_used = '1'

View File

@@ -458,6 +458,7 @@ public class StorPublicServiceImpl implements StorPublicService {
map.put("inv_type","");
map.put("inv_id","");
map.put("inv_code","");
map.put("point_status","00");
//是否清空载具
if("1".equals(from.getString("is_free"))){
map.put("storagevehicle_code","");

View File

@@ -399,7 +399,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
dtl.put("storagevehicle_type", ivt.getString("storagevehicle_type"));
dtl.put("is_issued", "0");
dtl.put("plan_qty", ivt.getDoubleValue("change_qty"));
dtl.put("real_qty", "0");
dtl.put("real_qty", ivt.getDoubleValue("change_qty"));
wo_dis.insert(dtl);
//记录需锁定的仓位
Struct_map.put(ivt.getString("struct_id"), ivt);
@@ -574,9 +574,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
JSONObject point = wo_Point.query("lock_type='00' and (vehicle_code='' or vehicle_code IS NULL) and point_code='" + point_code + "'").uniqueResult(0);
//如果终点站点被锁定或者有载具号,则不允许设置点位
if (ObjectUtil.isEmpty(point)) {
/* if (ObjectUtil.isEmpty(point)) {
throw new BadRequestException("该站点被锁定或者有载具号,不允许设置!");
}
}*/
//查询未生成和生成未下发的分配记录
JSONArray diss = WQL.getWO("QST_IVT_CHECKOUTBILL")
.addParam("flag", "5")
@@ -619,22 +619,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
task = new JSONObject();
task_id = IdUtil.getSnowflake(1, 1).nextId() + "";
String task_code = CodeUtil.getNewCode("TASK_CODE");
task.put("taskdtl_id", task_id);
task.put("task_id", task_id);
task.put("task_code", task_code);
task.put("task_type", "02");
//默认拣选
task.put("taskdtl_type", "05");
//根据可用数是否为0设置拣选还是全出
boolean flag = this.canuse_is_zero(dis.getString("struct_code"));
if (flag) {
task.put("taskdtl_type", "02");
task.put("task_type", "02");
}
task.put("task_status", "01");
task.put("start_point_code", dis.getString("start_point_code"));
task.put("next_point_code", point.getString("point_code"));
task.put("vehicle_code", dis.getString("storagevehicle_code"));
task.put("handle_class", "");
task.put("point_code1", dis.getString("struct_code"));
task.put("point_code2", point.getString("point_code"));
// task.put("vehicle_code", dis.getString("storagevehicle_code"));
task.put("handle_class", CheckOutBillServiceImpl.class.getName());
task.put("finished_type", "");
task.put("is_delete", "0");
task.put("create_id", currentUserId);
@@ -650,20 +647,20 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
map.put("work_status", "01");
map.put("task_id", task_id);
map.put("point_id", point.getString("point_id"));
map.put("point_code", point.getString("point_code"));
map.put("point_name", point.getString("point_name"));
// map.put("point_code", point.getString("point_code"));
// map.put("point_name", point.getString("point_name"));
wo_dis.update(map, "iostorinv_id='" + iostorinv_id + "' and storagevehicle_code='" + storagevehicle_code + "'");
//锁定点位仓位
JSONObject from_end = new JSONObject();
/* JSONObject from_end = new JSONObject();
from_end.put("point_code", point.getString("point_code"));
from_end.put("lock_type", "01");
from_end.put("inv_type", jo_mst.getString("bill_type"));
from_end.put("inv_id", jo_mst.getString("iostorinv_id"));
from_end.put("inv_code", jo_mst.getString("bill_code"));
from_end.put("taskdtl_type", task.getString("taskdtl_type"));
from_end.put("taskdtl_id", task.getString("taskdtl_id"));
from_end.put("taskdtl_type", task.getString("task_type"));
from_end.put("taskdtl_id", task.getString("task_id"));
from_end.put("task_code", task.getString("task_code"));
storPublicService.updateStructAndPoint(from_end);
storPublicService.updateStructAndPoint(from_end);*/
}
}
@@ -756,7 +753,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
dtl.put("storagevehicle_type", ivt.getString("storagevehicle_type"));
dtl.put("is_issued", "0");
dtl.put("plan_qty", ivt.getDoubleValue("change_qty"));
dtl.put("real_qty", "0");
dtl.put("real_qty", ivt.getDoubleValue("change_qty"));
wo_dis.insert(dtl);
//记录需锁定的仓位
Struct_map.put(ivt.getString("struct_id"), ivt);
@@ -865,7 +862,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
double plan_qty = dis.getDoubleValue("plan_qty");
double real_qty = dis.getDoubleValue("real_qty");
//全出判断是否全出
if ("02".equals(dis.getString("taskdtl_type"))) {
if ("02".equals(dis.getString("task_type"))) {
if (plan_qty != real_qty) {
throw new BadRequestException(dis.getString("storagevehicle_code") + "全出载具未完成出库!");
}
@@ -897,10 +894,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
}
storPublicService.updateStructAndPoint(from_start);
//解锁终点
JSONObject from_end = new JSONObject();
/* JSONObject from_end = new JSONObject();
from_end.put("point_code", dis.getString("point_code"));
from_end.put("struct_id", dis.getString("source_id"));
from_end.put("lock_type", "00");
storPublicService.updateStructAndPoint(from_end);
storPublicService.updateStructAndPoint(from_end);*/
}
}
@@ -950,20 +948,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
WQLObject wo_dtl = WQLObject.getWQLObject("st_ivt_iostorinvdtl");
//任务表
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
String taskdtl_id = whereJson.getString("taskdtl_id");
String task_id = whereJson.getString("task_id");
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now();
JSONObject task = wo_Task.query("task_status<>'99' and taskdtl_id='" + taskdtl_id + "'").uniqueResult(0);
JSONObject task = wo_Task.query("task_status<>'99' and task_id='" + task_id + "'").uniqueResult(0);
if (task == null) {
throw new BadRequestException("查询不到操作的任务记录!");
}
String taskdtl_type = task.getString("taskdtl_type");
String task_id = task.getString("task_id");
String task_type = task.getString("task_type");
JSONObject dtljo = wo_dis.query("task_id='" + task_id + "'").uniqueResult(0);
whereJson.put("iostorinv_id", dtljo.getString("iostorinv_id"));
HashMap<String, String> map = new HashMap<>();
@@ -973,12 +970,12 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
map.put("update_optid", currentUserId + "");
map.put("update_optname", nickName);
map.put("update_time", now);
wo_Task.update(map, "taskdtl_id='" + taskdtl_id + "'");
if ("05".equals(taskdtl_type)) {//拣选出库
wo_Task.update(map, "task_id='" + task_id + "'");
/* if ("05".equals(task_type)) {//拣选出库
//更新分配表
map.put("work_status", "02");
wo_dis.update(map, "task_id='" + task_id + "'");
} else if ("06".equals(taskdtl_type)) {//拣选回库
} else if ("06".equals(task_type)) {//拣选回库
map.put("work_status", "99");
wo_dis.update(map, "task_id='" + task_id + "'");
//判断是否还有未完成的明细
@@ -994,6 +991,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
if (ja.size() == 0) {
this.confirm(whereJson);
}
}*/
map.put("work_status", "99");
wo_dis.update(map, "task_id='" + task_id + "'");
// 更新明细为完成
/* JSONObject jsonDtl = wo_dtl.query("iostorinvdtl_id = '" + whereJson.getString("iostorinvdtl_id") + "'").uniqueResult(0);
jsonDtl.put("bill_status", "99");
wo_dtl.update(jsonDtl);*/
//判断是否还有未完成的明细
JSONArray ja = wo_dtl.query("bill_status<>'99' and iostorinv_id='" + whereJson.getString("iostorinv_id") + "'").getResultJSONArray(0);
if (ja.size() == 0) {
this.confirm(whereJson);
}
}
@@ -1245,6 +1255,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
jo_mst.put("update_optid", currentUserId + "");
jo_mst.put("update_optname", nickName);
jo_mst.put("update_time", now);
jo_mst.put("dis_optid", currentUserId + "");
jo_mst.put("dis_optname", nickName);
jo_mst.put("dis_time", now);
//更新主表状态
JSONArray dtls_40 = wo_dtl.query("bill_status='40' and iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
//已分配完明细数小于总明细数

View File

@@ -331,10 +331,10 @@
mb.material_name,
task.task_code,
task.task_status,
task.taskdtl_type,
task.task_type,
point.point_code AS start_point_code,
point2.area_type,
point2.source_id
point2.source_id,
point2.point_code
FROM
ST_IVT_IOStorInvDis dis
LEFT JOIN md_me_materialbase mb ON mb.material_id = dis.material_id
@@ -342,7 +342,7 @@
LEFT JOIN SCH_BASE_Point point ON point.source_id = dis.struct_id
LEFT JOIN SCH_BASE_Point point2 ON point2.point_id = dis.point_id
WHERE
1 = 1 and task.taskdtl_type in('05','02')
1 = 1
OPTION 输入.iostorinvdtl_id <> ""
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
ENDOPTION