rev:二期移库
This commit is contained in:
@@ -63,6 +63,12 @@ public class StructattrServiceImpl implements StructattrService {
|
||||
map.put("is_used", (String) whereJson.get("is_used"));
|
||||
map.put("is_have", (String) whereJson.get("is_have"));
|
||||
|
||||
// 如果是二期仓库则将层数删除
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get("stor_id"))) {
|
||||
if ( whereJson.get("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
map.put("layer_num", "");
|
||||
}
|
||||
}
|
||||
//获取人员对应的仓库
|
||||
UserStorServiceImpl userStorService = new UserStorServiceImpl();
|
||||
String in_stor_id = userStorService.getInStor();
|
||||
|
||||
@@ -78,8 +78,16 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
|
||||
for (Long moveinv_id : ids) {
|
||||
this.deleteById(moveinv_id + "");
|
||||
JSONObject jo_mst = wo_mst.query("moveinv_id='" + moveinv_id + "'").uniqueResult(0);
|
||||
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
this.deleteByIdTwo(moveinv_id + "");
|
||||
} else {
|
||||
this.deleteById(moveinv_id + "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,6 +166,77 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
jsonAttr.put("storagevehicle_code", "");
|
||||
wo_Attr.update(jsonAttr);
|
||||
|
||||
}
|
||||
/**
|
||||
* 通过moveinv_id删除明细,还原库存等操作(二期)
|
||||
*
|
||||
* @param moveinv_id
|
||||
*/
|
||||
public void deleteByIdTwo(String moveinv_id) {
|
||||
//明细表
|
||||
WQLObject wo_dtl = WQLObject.getWQLObject("ST_IVT_MoveInvDtl");
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
//任务表
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
//仓位表
|
||||
WQLObject wo_Attr = WQLObject.getWQLObject("st_ivt_structattr");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_delete", "1");
|
||||
map.put("update_optid", currentUserId + "");
|
||||
map.put("update_optname", nickName);
|
||||
map.put("update_time", now);
|
||||
JSONObject jo_mst = wo_mst.query("moveinv_id='" + moveinv_id + "'").uniqueResult(0);
|
||||
JSONArray ja = wo_dtl.query("moveinv_id='" + moveinv_id + "'").getResultJSONArray(0);
|
||||
String point_code2 = "";
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
//删除任务
|
||||
HashMap<String, String> task_map = new HashMap<>();
|
||||
task_map.put("is_delete", "1");
|
||||
point_code2 = wo_Task.query("task_id = '" + jo.getString("task_id") + "'").uniqueResult(0).getString("point_code2");
|
||||
wo_Task.update(task_map, "task_id='" + jo.getString("task_id") + "'");
|
||||
//解锁起点点位、仓位
|
||||
JSONObject from_start = new JSONObject();
|
||||
from_start.put("lock_type", "1");
|
||||
from_start.put("is_free", "0");
|
||||
from_start.put("struct_id", jo.getString("turnout_struct_id"));
|
||||
from_start.put("storagevehicle_code", jo.getString("storagevehicle_code"));
|
||||
storPublicService.updateStructAndPointTwo(from_start);
|
||||
//解锁终点点位、仓位
|
||||
from_start.put("struct_id", jo.getString("turnin_struct_id"));
|
||||
storPublicService.updateStructAndPointTwo(from_start);
|
||||
|
||||
//更新移出库存
|
||||
jo.put("struct_id", jo.getString("turnout_struct_id"));
|
||||
jo.put("change_qty", jo.getDoubleValue("qty"));
|
||||
jo.put("bill_type_scode", jo_mst.getString("bill_type"));
|
||||
jo.put("inv_id", jo.getString("moveinvdtl_id"));
|
||||
jo.put("bill_code", jo_mst.getString("bill_code"));
|
||||
jo.put("bill_table", "ST_IVT_MoveInv");
|
||||
storPublicService.IOStor(jo, "12");
|
||||
//更新移入库存
|
||||
jo.put("struct_id", jo.getString("turnin_struct_id"));
|
||||
jo.put("bill_type_scode", jo_mst.getString("bill_type"));
|
||||
jo.put("inv_id", jo.getString("moveinvdtl_id"));
|
||||
jo.put("bill_code", jo_mst.getString("bill_code"));
|
||||
jo.put("bill_table", "ST_IVT_MoveInv");
|
||||
storPublicService.IOStor(jo, "32");
|
||||
//删除明细
|
||||
wo_dtl.delete("moveinvdtl_id='" + jo.getString("moveinvdtl_id") + "'");
|
||||
}
|
||||
//更新主表
|
||||
wo_mst.update(map, "moveinv_id='" + moveinv_id + "'");
|
||||
// 更新移入仓位
|
||||
|
||||
JSONObject jsonAttr = wo_Attr.query("struct_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
jsonAttr.put("storagevehicle_code", "");
|
||||
wo_Attr.update(jsonAttr);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -174,6 +253,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
//主表
|
||||
WQLObject wo_mst = WQLObject.getWQLObject("ST_IVT_MoveInv");
|
||||
ArrayList<Map> rows = (ArrayList<Map>) map.get("tableData");
|
||||
JSONArray arrayTwo = MapUtil.get(map, "tableData", JSONArray.class);
|
||||
map.remove("tableData");
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
@@ -199,8 +279,15 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
map.put("sysdeptid", deptId);
|
||||
map.put("syscompanyid", deptId);
|
||||
JSONObject jo_mst = JSONObject.parseObject(JSON.toJSONString(map));
|
||||
//调用明细处理方法
|
||||
JSONObject ret = this.insertDtlByRows(jo_mst, rows);
|
||||
|
||||
//调用明细处理方法 -- 如果是二期移库则调用 insertDtlByRows2
|
||||
JSONObject ret = new JSONObject();
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
ret = this.insertDtlByRows2(jo_mst, arrayTwo);
|
||||
} else {
|
||||
ret = this.insertDtlByRows(jo_mst, rows);
|
||||
}
|
||||
|
||||
map.put("detail_count", ret.getString("detail_count"));
|
||||
map.put("total_qty", ret.getString("total_qty"));
|
||||
wo_mst.insert(map);
|
||||
@@ -554,6 +641,8 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
WQLObject wo_Task = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
//点位表
|
||||
WQLObject wo_Point = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
//载具扩展属性
|
||||
WQLObject extTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
//定义返回数据
|
||||
JSONObject ret = new JSONObject();
|
||||
|
||||
@@ -640,6 +729,12 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
task.put("point_code2", row.getString("turnin_struct_code"));
|
||||
}
|
||||
task.put("vehicle_code", jo.getString("storagevehicle_code"));
|
||||
// 查询木箱对应载具
|
||||
JSONObject jsonExt = extTab.query("pcsn = '" + jo.getString("storagevehicle_code") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonExt)) {
|
||||
throw new BadRequestException("此木箱对应载具不存在!"+jo.getString("storagevehicle_code"));
|
||||
}
|
||||
task.put("vehicle_code2", jsonExt.getString("storagevehicle_code"));
|
||||
task.put("handle_class", HandMoveStorAcsTask.class.getName());
|
||||
task.put("finished_type", "");
|
||||
task.put("is_delete", "0");
|
||||
@@ -724,12 +819,25 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
String moveinv_id = (String) whereJson.get("moveinv_id");
|
||||
//查询主表
|
||||
JSONObject jo_mst = wo_mst.query("moveinv_id='" + moveinv_id + "'").uniqueResult(0);
|
||||
|
||||
//调用删除明细,还原库存方法
|
||||
this.deleteById(moveinv_id + "");
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
this.deleteByIdTwo(moveinv_id + "");
|
||||
} else {
|
||||
this.deleteById(moveinv_id + "");
|
||||
}
|
||||
|
||||
//获取明细
|
||||
ArrayList<Map> rows = (ArrayList<Map>) whereJson.get("tableData");
|
||||
JSONArray arrayTwo = MapUtil.get(whereJson, "tableData", JSONArray.class);
|
||||
|
||||
//调用明细处理方法
|
||||
JSONObject ret = this.insertDtlByRows(jo_mst, rows);
|
||||
JSONObject ret ;
|
||||
if (jo_mst.getString("stor_id").equals(IOSEnum.STOR_ID.code("二期"))) {
|
||||
ret = this.insertDtlByRows2(jo_mst, arrayTwo);
|
||||
} else {
|
||||
ret = this.insertDtlByRows(jo_mst, rows);
|
||||
}
|
||||
jo_mst.put("remark", whereJson.get("remark"));
|
||||
jo_mst.put("biz_date", whereJson.get("biz_date"));
|
||||
jo_mst.put("detail_count", ret.getString("detail_count"));
|
||||
@@ -993,7 +1101,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
from_start.put("lock_type", "1");
|
||||
from_start.put("storagevehicle_code", jo.getString("storagevehicle_code"));
|
||||
from_start.put("struct_id", jo.getString("turnout_struct_id"));
|
||||
if (form.getString("turnout_sect_code").equals("BZC01")) {
|
||||
if (jo.getString("turnout_sect_code").equals("BZC01")) {
|
||||
storPublicService.updateStructAndPointTwo(from_start);
|
||||
} else {
|
||||
storPublicService.updateStructAndPoint(from_start);
|
||||
@@ -1004,7 +1112,7 @@ public class HandMoveStorServiceImpl implements HandMoveStorService {
|
||||
from_end.put("struct_id", jo.getString("turnin_struct_id"));
|
||||
from_end.put("is_free", "0");
|
||||
from_end.put("storagevehicle_code", jo.getString("storagevehicle_code"));
|
||||
if (form.getString("turnout_sect_code").equals("BZC01")) {
|
||||
if (jo.getString("turnout_sect_code").equals("BZC01")) {
|
||||
storPublicService.updateStructAndPointTwo(from_end);
|
||||
} else {
|
||||
storPublicService.updateStructAndPoint(from_end);
|
||||
|
||||
Reference in New Issue
Block a user