rev: 成品入库功能修改
This commit is contained in:
@@ -0,0 +1,196 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.basedata.st.service.dto.StructattrDto;
|
||||
import org.nl.wms.basedata.st.service.impl.StructattrServiceImpl;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.TaskService;
|
||||
import org.nl.wms.st.in.service.impl.ProductInServiceImpl;
|
||||
import org.nl.wms.st.in.service.impl.StorPublicServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* Created by Lxy on 2023/03/30.
|
||||
*/
|
||||
public class ProductInTask extends AbstractAcsTask {
|
||||
|
||||
private final String THIS_CLASS = ProductInTask.class.getName();
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配表
|
||||
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库主表
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl"); // 出入库明细表
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
|
||||
//1:执行中,2:完成 ,0:acs取消
|
||||
if (StrUtil.equals(status, "1")) {
|
||||
map.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
//更新入库单分配任务状态
|
||||
HashMap<String, String> dis_map = new HashMap<>();
|
||||
dis_map.put("work_status", "02");
|
||||
dis_map.put("is_issued", "1");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
if (StrUtil.equals(status, "2")) {
|
||||
map.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
//调用入库分配确认方法
|
||||
ProductInServiceImpl productInService = SpringContextHolder.getBean(ProductInServiceImpl.class);
|
||||
JSONObject dis_form = new JSONObject();
|
||||
dis_form.put("task_id", taskObj.getString("task_id"));
|
||||
productInService.confirmDis(dis_form);
|
||||
}
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject struct_table = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||
|
||||
if (taskObj.getIntValue("task_status") > Integer.valueOf(TaskStatusEnum.ISSUE.getCode())) {
|
||||
throw new BadRequestException("任务已执行不能取消");
|
||||
}
|
||||
|
||||
// 更新任务表删除字段
|
||||
map.put("is_delete","1");
|
||||
|
||||
JSONObject jsonDis = disTab.query("task_id ='" + taskObj.getString("task_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonDis)) throw new BadRequestException("分配明细不存在");
|
||||
String iostorinv_id = jsonDis.getString("iostorinv_id");
|
||||
|
||||
// 解锁货位
|
||||
HashMap<String, String> unlock_map = new HashMap<>();
|
||||
unlock_map.put("lock_type", "1");
|
||||
unlock_map.put("taskdtl_type", "");
|
||||
unlock_map.put("taskdtl_id", "");
|
||||
unlock_map.put("task_code", "");
|
||||
unlock_map.put("inv_type", "");
|
||||
unlock_map.put("inv_id", "");
|
||||
unlock_map.put("inv_code", "");
|
||||
point_table.update(unlock_map, "point_code = '" + taskObj.get("point_code2") + "'");
|
||||
struct_table.update(unlock_map, "struct_code = '" + taskObj.get("point_code2") + "'");
|
||||
|
||||
//减去原货位的待入数
|
||||
JSONArray dis_rows = disTab.query("struct_code = '" + taskObj.get("point_code2") + "' AND work_status < '99'").getResultJSONArray(0);
|
||||
if (dis_rows.size() <= 0) {
|
||||
throw new BadRequestException("数据参数有误!");
|
||||
}
|
||||
|
||||
StructattrDto old_struct = new StructattrServiceImpl().findByCode(taskObj.getString("point_code2"));
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + dis_rows.getJSONObject(0).getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject i_form = new JSONObject();
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
i_form.put("struct_id", old_struct.getStruct_id());
|
||||
i_form.put("material_id", dis_row.getString("material_id"));
|
||||
i_form.put("quality_scode", dis_row.getString("quality_scode"));
|
||||
i_form.put("pcsn", dis_row.getString("pcsn"));
|
||||
i_form.put("ivt_level", dis_row.getString("ivt_level"));
|
||||
i_form.put("change_qty", dis_row.getString("plan_qty"));
|
||||
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
|
||||
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
|
||||
i_form.put("bill_code", mst_jo.getString("bill_code"));
|
||||
i_form.put("bill_table", "ST_IVT_IOStorInv");
|
||||
i_form.put("qty_unit_id", dis_row.getString("qty_unit_id"));
|
||||
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
|
||||
new StorPublicServiceImpl().IOStor(i_form,"32");
|
||||
}
|
||||
|
||||
// 修改主表状态为分配中:30
|
||||
JSONObject mstMap = new JSONObject();
|
||||
mstMap.put("bill_status", "30");
|
||||
mstMap.put("update_optid", currentUserId);
|
||||
mstMap.put("update_optname", nickName);
|
||||
mstMap.put("update_time", now);
|
||||
mstTab.update(mstMap,"iostorinv_id = '"+iostorinv_id+"'");
|
||||
|
||||
// 修改明细状态为生成:10
|
||||
JSONObject dtlMap = new JSONObject();
|
||||
dtlMap.put("bill_status", "10");
|
||||
dtlTab.update(dtlMap,"iostorinv_id = '"+iostorinv_id+"'");
|
||||
|
||||
// 更新分配明细为:未生成:00,清空对应字段
|
||||
JSONObject disMap = new JSONObject();
|
||||
disMap.put("work_status", "00");
|
||||
disMap.put("point_id", "");
|
||||
disMap.put("task_id", "");
|
||||
disMap.put("sect_id", "");
|
||||
disMap.put("sect_code", "");
|
||||
disMap.put("sect_name", "");
|
||||
disMap.put("struct_id", "");
|
||||
disMap.put("struct_code", "");
|
||||
disMap.put("struct_name", "");
|
||||
disTab.update(disMap,"task_id = '"+taskObj.getString("task_id")+"'");
|
||||
}
|
||||
map.put("update_optid", currentUserId);
|
||||
map.put("update_optname", nickName);
|
||||
map.put("update_time", now);
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").update(map, "task_id = '" + taskObj.getString("task_id") + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String createTask(JSONObject form) {
|
||||
|
||||
String task_type = form.getString("task_type");
|
||||
if (StrUtil.isBlank(task_type)) {
|
||||
throw new BadRequestException("业务类型不能为空");
|
||||
}
|
||||
String start_device_code = form.getString("start_device_code");
|
||||
if (StrUtil.isBlank(start_device_code)) {
|
||||
throw new BadRequestException("起点不能为空");
|
||||
}
|
||||
String next_device_code = form.getString("next_device_code");
|
||||
if (StrUtil.isBlank(next_device_code)) {
|
||||
throw new BadRequestException("终点不能为空");
|
||||
}
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
if (StrUtil.isBlank(vehicle_code)) {
|
||||
throw new BadRequestException("载具号不能为空");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
json.put("task_code", IdUtil.getSnowflake(1,1).nextId());
|
||||
json.put("product_area", form.getString("product_area"));
|
||||
json.put("task_type", form.getString("task_type"));
|
||||
json.put("is_send", "1");
|
||||
json.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
json.put("point_code1", start_device_code);
|
||||
json.put("point_code2", next_device_code);
|
||||
json.put("vehicle_code", form.getString("vehicle_code"));
|
||||
json.put("handle_class", this.getClass().getName());
|
||||
json.put("create_id", currentUserId);
|
||||
json.put("create_name", currentUsername);
|
||||
json.put("create_time", DateUtil.now());
|
||||
json.put("update_id", currentUserId);
|
||||
json.put("update_name", currentUsername);
|
||||
json.put("update_time", DateUtil.now());
|
||||
WQLObject.getWQLObject("SCH_BASE_Task").insert(json);
|
||||
|
||||
return json.getString("task_id");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
JSONObject taskObj = WQLObject.getWQLObject("SCH_BASE_Task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
this.updateTaskStatus(taskObj, "0");
|
||||
}
|
||||
}
|
||||
@@ -118,18 +118,11 @@ public class ProductInController {
|
||||
@PostMapping("/divPoint")
|
||||
@Log("设置起点")
|
||||
@ApiOperation("设置起点")
|
||||
public ResponseEntity<Object> divPoint(@RequestBody Map whereJson) {
|
||||
public ResponseEntity<Object> divPoint(@RequestBody JSONObject whereJson) {
|
||||
productInService.divPoint(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/queryTask")
|
||||
@Log("查询任务")
|
||||
@ApiOperation("查询任务")
|
||||
public ResponseEntity<Object> queryTask(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(productInService.queryTask(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/delDis")
|
||||
@Log("删除分配")
|
||||
@ApiOperation("删除分配")
|
||||
@@ -153,38 +146,6 @@ public class ProductInController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/delTask")
|
||||
@Log("删除任务")
|
||||
@ApiOperation("删除任务")
|
||||
public ResponseEntity<Object> delTask(@RequestBody Map whereJson) {
|
||||
productInService.delTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/reIssueTask")
|
||||
@Log("下发")
|
||||
@ApiOperation("下发")
|
||||
public ResponseEntity<Object> reIssueTask(@RequestBody Map whereJson) {
|
||||
productInService.reIssueTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/confirmTask")
|
||||
@Log("完成任务")
|
||||
@ApiOperation("完成任务")
|
||||
public ResponseEntity<Object> confirmTask(@RequestBody Map whereJson) {
|
||||
productInService.confirmTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/cancelTask")
|
||||
@Log("取消完成任务")
|
||||
@ApiOperation("取消完成任务")
|
||||
public ResponseEntity<Object> cancelTask(@RequestBody Map whereJson) {
|
||||
productInService.cancelTask(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/confirm")
|
||||
@Log("完成单据")
|
||||
@ApiOperation("完成单据")
|
||||
@@ -193,14 +154,6 @@ public class ProductInController {
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/backConfirm")
|
||||
@Log("完成入库负单")
|
||||
@ApiOperation("完成入库负单")
|
||||
public ResponseEntity<Object> backConfirm(@RequestBody Map whereJson) {
|
||||
productInService.backConfirm(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/autoDis")
|
||||
@Log("自动分配")
|
||||
@ApiOperation("自动分配")
|
||||
@@ -208,4 +161,11 @@ public class ProductInController {
|
||||
productInService.autoDis(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@PostMapping("/getDisTask")
|
||||
@Log("获取明细任务")
|
||||
@ApiOperation("获取明细任务")
|
||||
public ResponseEntity<Object> getDisTask(@RequestBody JSONObject whereJson) {
|
||||
return new ResponseEntity<>(productInService.getDisTask(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,22 +62,16 @@ public interface ProductInService {
|
||||
*/
|
||||
void unDivStruct(JSONObject whereJson);
|
||||
|
||||
void divPoint(Map whereJson);
|
||||
/**
|
||||
* 设置起点
|
||||
* @param whereJson /
|
||||
*/
|
||||
void divPoint(JSONObject whereJson);
|
||||
|
||||
void updateTask(Map whereJson);
|
||||
|
||||
void delTask(Map whereJson);
|
||||
|
||||
void reIssueTask(Map whereJson);
|
||||
|
||||
void confirmTask(Map whereJson);
|
||||
|
||||
void cancelTask(Map whereJson);
|
||||
|
||||
void confirm(Map whereJson);
|
||||
|
||||
void backConfirm(Map whereJson);
|
||||
|
||||
/**
|
||||
* 查询入库分配明细
|
||||
* @param whereJson /
|
||||
@@ -85,8 +79,6 @@ public interface ProductInService {
|
||||
*/
|
||||
JSONArray getDisDtl(JSONObject whereJson);
|
||||
|
||||
JSONArray queryTask(Map whereJson);
|
||||
|
||||
/**
|
||||
* 自动分配
|
||||
* @param whereJson /
|
||||
@@ -94,8 +86,6 @@ public interface ProductInService {
|
||||
*/
|
||||
JSONObject autoDis(JSONObject whereJson);
|
||||
|
||||
JSONObject autoDisMove(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 查询仓库
|
||||
* @return JSONArray
|
||||
@@ -107,4 +97,10 @@ public interface ProductInService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
void confirmvehicle(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 获取分配明细任务
|
||||
* @param whereJson /
|
||||
*/
|
||||
JSONArray getDisTask(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -3,10 +3,8 @@ package org.nl.wms.st.in.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -21,17 +19,16 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.system.service.param.impl.SysParamServiceImpl;
|
||||
import org.nl.wms.basedata.st.service.StorattrService;
|
||||
import org.nl.wms.basedata.st.service.StructattrService;
|
||||
import org.nl.wms.basedata.st.service.dto.StorattrDto;
|
||||
import org.nl.wms.basedata.st.service.dto.StructattrDto;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.sch.tasks.ProductInTask;
|
||||
import org.nl.wms.st.in.service.ProductInService;
|
||||
import org.nl.wms.st.in.service.StorPublicService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
@@ -333,7 +330,8 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
@Override
|
||||
public JSONArray getIODtl(JSONObject whereJson) {
|
||||
String bill_code = whereJson.getString("bill_code");
|
||||
JSONArray ja = WQL.getWO("QST_IVT_PRODUCTIN_01").addParam("flag", "2").addParam("bill_code", bill_code)
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
JSONArray ja = WQL.getWO("QST_IVT_PRODUCTIN_01").addParam("flag", "2").addParam("bill_code", bill_code).addParam("iostorinv_id", iostorinv_id)
|
||||
.process().getResultJSONArray(0);
|
||||
return ja;
|
||||
}
|
||||
@@ -435,20 +433,20 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
jsonPoint1.put("lock_type", "2");
|
||||
pointTab.update(jsonPoint1);
|
||||
// 判断是否需要锁定两个货位
|
||||
if (is_length.equals("1")) {
|
||||
if (StrUtil.equals(is_length, "1")) {
|
||||
JSONObject jsonPoint2 = pointTab.query("point_id = '" + jsonPoint1.getString("control_point") + "'").uniqueResult(0);
|
||||
jsonPoint2.put("lock_type", "2");
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
// 更新分配明细
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinv_id = '" + map.get("iostorinv_id") + "'");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(dis_map, "iostorinvdtl_id = '" + map.get("iostorinvdtl_id") + "'");
|
||||
|
||||
/*
|
||||
* 更新库存
|
||||
*/
|
||||
//直接取出入库分配表的库存
|
||||
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "'").getResultJSONArray(0);
|
||||
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + map.get("iostorinvdtl_id") + "'").getResultJSONArray(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_jo = dis_rows.getJSONObject(i);
|
||||
JSONObject i_form = new JSONObject();
|
||||
@@ -473,7 +471,7 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
if (disdiv_rows.size() == 0) {
|
||||
dtl_jo.put("bill_status", "30");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
|
||||
//判断主表下的明细是否都为40
|
||||
//判断主表下的明细是否都为30
|
||||
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + dis_jo.getString("iostorinv_id") + "' AND bill_status < '30'").getResultJSONArray(0);
|
||||
if (dtl_rows.size() == 0) {
|
||||
mst.put("bill_status", "30");
|
||||
@@ -554,12 +552,12 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
map.put("struct_code", "");
|
||||
map.put("struct_name", "");
|
||||
map.put("work_status", "00");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "'");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(map, "iostorinvdtl_id = '" + whereJson.getString("iostorinvdtl_id") + "'");
|
||||
|
||||
//修改明细状态
|
||||
HashMap<String, String> dtl_map = new HashMap<>();
|
||||
dtl_map.put("bill_status", "10");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "'");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_map, "iostorinvdtl_id = '" + whereJson.get("iostorinvdtl_id") + "'");
|
||||
|
||||
//更新主表状态
|
||||
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND bill_status IN ('20','30')").getResultJSONArray(0);
|
||||
@@ -573,14 +571,11 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void divPoint(Map whereJson) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
public void divPoint(JSONObject whereJson) {
|
||||
|
||||
ArrayList<HashMap> rows = (ArrayList<HashMap>) whereJson.get("tableMater");
|
||||
String point_code = (String) whereJson.get("point_code");
|
||||
HashMap<String, String> map = rows.get(0);
|
||||
JSONArray rows = whereJson.getJSONArray("tableMater");
|
||||
String point_code = whereJson.getString("point_code");
|
||||
JSONObject map = rows.getJSONObject(0);
|
||||
|
||||
HashMap<String, String> point_map = new HashMap<>();
|
||||
PointDto pointDto = pointService.findByCode(point_code);
|
||||
@@ -588,65 +583,27 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
point_map.put("point_id", pointDto.getPoint_id() + "");
|
||||
point_map.put("point_name", pointDto.getPoint_name());
|
||||
|
||||
JSONObject mst = WQLObject.getWQLObject("st_ivt_iostorinv").query("iostorinv_id = '" + map.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
|
||||
//判断起点终点是否不为空
|
||||
JSONObject ios_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'").uniqueResult(0);
|
||||
JSONObject ios_dis = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + map.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(ios_dis.getString("struct_code"))) {
|
||||
//创建任务
|
||||
// AbstractAcsTask task = new InTask();
|
||||
ProductInTask task = new ProductInTask();
|
||||
|
||||
JSONObject task_form = new JSONObject();
|
||||
task_form.put("task_type", "010501");
|
||||
task_form.put("start_device_code", point_code);
|
||||
task_form.put("next_device_code", ios_dis.getString("struct_code"));
|
||||
task_form.put("vehicle_code", map.get("box_no"));
|
||||
//查询主表信息
|
||||
JSONObject mst = WQLObject.getWQLObject("st_ivt_iostorinv").query("iostorinv_id = '" + map.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
task_form.put("inv_type", mst.get("bill_type"));
|
||||
task_form.put("inv_id", mst.get("iostorinv_id"));
|
||||
task_form.put("inv_code", mst.get("bill_code"));
|
||||
/* String task_id = task.createTask(task_form);
|
||||
task_form.put("vehicle_code", map.getString("storagevehicle_code"));
|
||||
task_form.put("product_area", mst.getString("product_code"));
|
||||
|
||||
String task_id = task.createTask(task_form);
|
||||
point_map.put("task_id", task_id);
|
||||
point_map.put("work_status", "01");*/
|
||||
point_map.put("work_status", "01");
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(point_map, "iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'");
|
||||
|
||||
if (StrUtil.isNotEmpty(ios_dis.getString("struct_code"))) {
|
||||
//修改库存
|
||||
//直接取出入库分配表的库存
|
||||
JSONArray dis_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinv_id = '" + map.get("iostorinv_id") + "' AND box_no = '" + map.get("box_no") + "'").getResultJSONArray(0);
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + map.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_jo = dis_rows.getJSONObject(i);
|
||||
//更新明细表状态
|
||||
JSONObject dtl_jo = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
if (dtl_jo.getDoubleValue("unassign_qty") == 0) {
|
||||
//判断该明细下是否还存在未分配货位的分配明细
|
||||
JSONArray disdiv_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDis").query("iostorinvdtl_id = '" + dis_jo.getString("iostorinvdtl_id") + "' AND (struct_id = '' OR struct_id is null) AND (point_id = '' OR point_id is null)").getResultJSONArray(0);
|
||||
if (disdiv_rows.size() == 0) {
|
||||
dtl_jo.put("bill_status", "40");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(dtl_jo);
|
||||
//判断主表下的明细是否都为40
|
||||
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + dis_jo.getString("iostorinv_id") + "' AND bill_status < '40'").getResultJSONArray(0);
|
||||
if (dtl_rows.size() == 0) {
|
||||
mst_jo.put("bill_status", "40");
|
||||
mst_jo.put("dis_optid", currentUserId);
|
||||
mst_jo.put("dis_optname", nickName);
|
||||
mst_jo.put("dis_time", now);
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryTask(Map whereJson) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "5");
|
||||
map.put("iostorinvdtl_id", (String) whereJson.get("iostorinvdtl_id"));
|
||||
map.put("is_finish", (String) whereJson.get("checked"));
|
||||
JSONArray rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).process().getResultJSONArray(0);
|
||||
return rows;
|
||||
// 更新分配明细表
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(point_map, "iostorinvdtl_id = '" + map.getString("iostorinvdtl_id") + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -720,300 +677,6 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
return struct_jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject autoDisMove(JSONObject whereJson) {
|
||||
/*
|
||||
* 分配逻辑:
|
||||
* 1、先查找该木箱内属于什么物料、订单,定位到具体的块、排,查看是否存在空位
|
||||
* a、存在的话,优先放在这一块这一排中(遍历)
|
||||
* b、不存在则根据该订单物料大概数量、选择数量相近的一个空巷道
|
||||
* 1)存在空巷道
|
||||
* 2)不存在,则找一个双通有空位置、数量相近的巷道
|
||||
* */
|
||||
|
||||
|
||||
JSONObject struct_jo = new JSONObject();
|
||||
|
||||
String box_no = whereJson.getString("box_no");
|
||||
|
||||
String sect_id = whereJson.getString("sect_id");
|
||||
|
||||
String col_num = whereJson.getString("layer_num"); // 转库时用
|
||||
|
||||
JSONObject sub_jo = WQLObject.getWQLObject("pdm_bi_subpackagerelation").query("package_box_sn = '" + box_no + "' AND status < 3").uniqueResult(0);
|
||||
|
||||
String material_code = sub_jo.getString("product_name");
|
||||
|
||||
String sale_order_name = sub_jo.getString("sale_order_name");
|
||||
|
||||
HashMap<String, String> row_map = new HashMap<>();
|
||||
row_map.put("material_code", material_code);
|
||||
row_map.put("sale_order_name", sale_order_name);
|
||||
row_map.put("col_num", col_num);
|
||||
row_map.put("sect_id", sect_id);
|
||||
row_map.put("flag", "11");
|
||||
//查询到当前可用的巷道
|
||||
JSONArray rowArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
|
||||
for (int i = 0; i < rowArr.size(); i++) {
|
||||
JSONObject row_jo = rowArr.getJSONObject(i);
|
||||
|
||||
String block_num = row_jo.getString("block_num");
|
||||
String row_num = row_jo.getString("row_num");
|
||||
String placement_type = row_jo.getString("placement_type");
|
||||
|
||||
// 判断此排是否有除:入库锁、移入锁以外的锁
|
||||
JSONArray isLock = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(isLock)) {
|
||||
if (placement_type.equals("02")) {
|
||||
// 左通
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||
break;
|
||||
} else if (placement_type.equals("03")) {
|
||||
// 右通
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||
break;
|
||||
} else {
|
||||
// 双通
|
||||
|
||||
// 先倒序找到第一个木箱、判断上一个是否有货位
|
||||
JSONObject jsonDescBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonDescStruct = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonDescBox)) {
|
||||
String out_order_seq = jsonDescBox.getString("out_order_seq");
|
||||
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else {
|
||||
// 先倒序找到第一个入库锁或者移库锁、判断上一个是否有货位
|
||||
JSONObject jsonDescEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescEmpStruct)) {
|
||||
String out_order_seq = jsonDescEmpStruct.getString("out_order_seq");
|
||||
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||
struct_jo = jsonDescStruct;
|
||||
break;
|
||||
} else {
|
||||
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonAscStruct = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonAscBox)) {
|
||||
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
} else {
|
||||
JSONObject jsonAscEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAscEmpStruct)) {
|
||||
String out_order_seq2 = jsonAscEmpStruct.getString("out_order_seq");
|
||||
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||
struct_jo = jsonAscStruct;
|
||||
break;
|
||||
} else {
|
||||
// 说明这排有任务在执行,新开一排
|
||||
//根据分切计划查询该订单物料大概还有多少未入
|
||||
row_map.put("flag", "12");
|
||||
JSONArray plan_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_rows)) {
|
||||
plan_rows = new JSONArray();
|
||||
}
|
||||
//查询该销售订单及行号有多少个生成状态的箱子
|
||||
row_map.put("flag", "27");
|
||||
JSONArray box_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(box_rows)) {
|
||||
box_rows = new JSONArray();
|
||||
}
|
||||
int box_num = (int) Math.ceil(plan_rows.size() / 2) + box_rows.size();
|
||||
|
||||
//查询数量与订单物料箱子数量相近的一排
|
||||
JSONObject empty_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("col_num", col_num).addParam("sect_id", sect_id).addParam("flag", "13").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num),block_num,row_num").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(empty_row)) {
|
||||
String block_num2 = empty_row.getString("block_num");
|
||||
String row_num2 = empty_row.getString("row_num");
|
||||
String placement_type2 = empty_row.getString("placement_type");
|
||||
|
||||
if (placement_type.equals("02")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
break;
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
//如果查询不到空的一排,则查询有空位双通的一排
|
||||
JSONArray haveArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("col_num", col_num).addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().getResultJSONArray(0);
|
||||
|
||||
for (int j = 0; j < haveArr.size(); j++) {
|
||||
JSONObject have_row = haveArr.getJSONObject(j);
|
||||
|
||||
String block_num3 = have_row.getString("block_num");
|
||||
String row_num3 = have_row.getString("row_num");
|
||||
|
||||
JSONArray isLock2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(isLock2)) {
|
||||
// 先倒序找到第一个木箱、判断上一个是否有货位
|
||||
JSONObject jsonDescBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonDescStruct2 = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonDescBox2)) {
|
||||
String out_order_seq = jsonDescBox2.getString("out_order_seq");
|
||||
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else {
|
||||
// 先倒序找到第一个入库锁或者移库锁、判断上一个是否有货位
|
||||
JSONObject jsonDescEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescEmpStruct)) {
|
||||
String out_order_seq = jsonDescEmpStruct.getString("out_order_seq");
|
||||
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescStruct2)) {
|
||||
struct_jo = jsonDescStruct2;
|
||||
break;
|
||||
} else {
|
||||
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||
JSONObject jsonAscBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonAscStruct2 = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonAscBox2)) {
|
||||
String out_order_seq2 = jsonAscBox2.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
} else {
|
||||
JSONObject jsonAscEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAscEmpStruct)) {
|
||||
String out_order_seq2 = jsonAscEmpStruct.getString("out_order_seq");
|
||||
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(jsonAscStruct2)) {
|
||||
struct_jo = jsonAscStruct2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(rowArr) || ObjectUtil.isEmpty(struct_jo)) {
|
||||
//如果不存在相同订单物料的巷道 或者未找到相同物料订单号巷道中的货位 则
|
||||
|
||||
//根据分切计划查询该订单物料大概还有多少未入
|
||||
row_map.put("flag", "12");
|
||||
JSONArray plan_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_rows)) {
|
||||
plan_rows = new JSONArray();
|
||||
}
|
||||
//查询该销售订单及行号有多少个生成状态的箱子
|
||||
row_map.put("flag", "27");
|
||||
JSONArray box_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(box_rows)) {
|
||||
box_rows = new JSONArray();
|
||||
}
|
||||
int box_num = (int) Math.ceil(plan_rows.size() / 2) + box_rows.size();
|
||||
|
||||
//查询数量与订单物料箱子数量相近的一排
|
||||
JSONObject empty_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("col_num", col_num).addParam("sect_id", sect_id).addParam("flag", "13").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num),block_num,row_num").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(empty_row)) {
|
||||
String block_num = empty_row.getString("block_num");
|
||||
String row_num = empty_row.getString("row_num");
|
||||
String placement_type = empty_row.getString("placement_type");
|
||||
|
||||
if (placement_type.equals("02")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '" + placement_type + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "' AND row_num = '" + row_num + "' AND placement_type = '" + placement_type + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
|
||||
}
|
||||
} else {
|
||||
|
||||
//如果查询不到空的一排,则查询有空位双通的一排
|
||||
JSONArray haveArr = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("col_num", col_num).addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().getResultJSONArray(0);
|
||||
for (int j = 0; j < haveArr.size(); j++) {
|
||||
JSONObject have_row = haveArr.getJSONObject(j);
|
||||
|
||||
String block_num3 = have_row.getString("block_num");
|
||||
String row_num3 = have_row.getString("row_num");
|
||||
|
||||
JSONArray isLock2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type not in ('1','2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1'").getResultJSONArray(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(isLock2)) {
|
||||
// 先倒序找到第一个木箱、判断上一个是否有货位
|
||||
JSONObject jsonDescBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonDescStruct2 = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonDescBox2)) {
|
||||
String out_order_seq = jsonDescBox2.getString("out_order_seq");
|
||||
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else {
|
||||
// 先倒序找到第一个入库锁或者移库锁、判断上一个是否有货位
|
||||
JSONObject jsonDescEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescEmpStruct)) {
|
||||
String out_order_seq = jsonDescEmpStruct.getString("out_order_seq");
|
||||
jsonDescStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq > '" + out_order_seq + "' order by out_order_seq ASC").uniqueResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescStruct2)) {
|
||||
struct_jo = jsonDescStruct2;
|
||||
break;
|
||||
} else {
|
||||
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||
JSONObject jsonAscBox2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonAscStruct2 = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonAscBox2)) {
|
||||
String out_order_seq2 = jsonAscBox2.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
} else {
|
||||
JSONObject jsonAscEmpStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type in ('2','7') AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAscEmpStruct)) {
|
||||
String out_order_seq2 = jsonAscEmpStruct.getString("out_order_seq");
|
||||
jsonAscStruct2 = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq < '" + out_order_seq2 + "' order by out_order_seq DESC").uniqueResult(0);
|
||||
}
|
||||
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(jsonAscStruct2)) {
|
||||
struct_jo = jsonAscStruct2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(struct_jo)) {
|
||||
throw new BadRequestException("未查询到可用的仓位!");
|
||||
}
|
||||
return struct_jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryStor() {
|
||||
WQLObject storTab = WQLObject.getWQLObject("st_ivt_bsrealstorattr");
|
||||
@@ -1045,6 +708,13 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getDisTask(JSONObject whereJson) {
|
||||
//查询该明细下的所有入库分配明细
|
||||
JSONArray resultJSONArray = WQL.getWO("QST_IVT_PRODUCTIN_01").addParam("flag", "4").addParam("iostorinvdtl_id", whereJson.get("iostorinvdtl_id")).process().getResultJSONArray(0);
|
||||
return resultJSONArray;
|
||||
}
|
||||
|
||||
public JSONObject queryEmpStruct(JSONObject whereJson) {
|
||||
JSONObject struct_jo = new JSONObject();
|
||||
String sect_id = whereJson.getString("sect_id");
|
||||
@@ -1200,192 +870,6 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delTask(Map whereJson) {
|
||||
WQLObject dis_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||
WQLObject task_wql = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject point_table = WQLObject.getWQLObject("SCH_BASE_Point");
|
||||
WQLObject struct_table = WQLObject.getWQLObject("ST_IVT_StructAttr");
|
||||
|
||||
|
||||
//判断指令状态,只能修改生成状态的任务
|
||||
/* String task_id = (String) whereJson.get("task_id");
|
||||
TaskDto taskDto = taskService.findByDtlId(task_id);
|
||||
if (ObjectUtil.isEmpty(taskDto)) {
|
||||
throw new BadRequestException("请输入正确的任务号!");
|
||||
}
|
||||
if (!taskDto.getTask_status().equals("01")) {
|
||||
throw new BadRequestException("只能修改任务状态为生成的任务!");
|
||||
}*/
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
//更新任务表状态为删除
|
||||
HashMap task_map = new HashMap<>();
|
||||
task_map.put("is_delete", "1");
|
||||
task_map.put("update_optid", currentUserId);
|
||||
task_map.put("update_optname", nickName);
|
||||
task_map.put("update_time", now);
|
||||
//修改分配表起点,任务表起点
|
||||
task_wql.update(task_map, "task_id = '" + whereJson.get("task_id") + "'");
|
||||
|
||||
//解锁原货位点位
|
||||
HashMap unlock_map = new HashMap();
|
||||
unlock_map.put("lock_type", "1");
|
||||
unlock_map.put("taskdtl_type", "");
|
||||
unlock_map.put("taskdtl_id", "");
|
||||
unlock_map.put("task_code", "");
|
||||
unlock_map.put("inv_type", "");
|
||||
unlock_map.put("inv_id", "");
|
||||
unlock_map.put("inv_code", "");
|
||||
point_table.update(unlock_map, "point_code = '" + whereJson.get("struct_code") + "'");
|
||||
struct_table.update(unlock_map, "struct_code = '" + whereJson.get("struct_code") + "'");
|
||||
|
||||
//减去原货位的待入数
|
||||
JSONArray dis_rows = dis_wql.query("task_id = '" + whereJson.get("task_id") + "'").getResultJSONArray(0);
|
||||
if (dis_rows.size() <= 0) {
|
||||
throw new BadRequestException("数据参数有误!");
|
||||
}
|
||||
StructattrDto old_struct = structattrService.findByCode((String) whereJson.get("struct_code"));
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + dis_rows.getJSONObject(0).getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject i_form = new JSONObject();
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
i_form.put("struct_id", old_struct.getStruct_id());
|
||||
i_form.put("material_id", dis_row.getString("material_id"));
|
||||
i_form.put("quality_scode", dis_row.getString("quality_scode"));
|
||||
i_form.put("pcsn", dis_row.getString("pcsn"));
|
||||
i_form.put("change_qty", dis_row.getString("plan_qty"));
|
||||
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
|
||||
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
|
||||
i_form.put("bill_code", mst_jo.getString("bill_code"));
|
||||
i_form.put("bill_table", "ST_IVT_IOStorInv");
|
||||
i_form.put("qty_unit_id", dis_row.getString("qty_unit_id"));
|
||||
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
|
||||
// storPublicService.IOStor(i_form, "32");
|
||||
|
||||
}
|
||||
//更新分配状态
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("point_id", "");
|
||||
map.put("sect_id", "");
|
||||
map.put("sect_code", "");
|
||||
map.put("sect_name", "");
|
||||
map.put("struct_id", "");
|
||||
map.put("struct_code", "");
|
||||
map.put("struct_name", "");
|
||||
map.put("task_id", "");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDis").update(map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND box_no = '" + whereJson.get("box_no") + "'");
|
||||
|
||||
//修改明细状态
|
||||
HashMap<String, String> dtl_map = new HashMap<>();
|
||||
map.put("bill_status", "10");
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").update(map, "iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND box_no = '" + whereJson.get("box_no") + "'");
|
||||
|
||||
//更新主表状态
|
||||
JSONArray dtl_rows = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl").query("iostorinv_id = '" + mst_jo.get("iostorinv_id") + "' AND bill_status IN ('20','30')").getResultJSONArray(0);
|
||||
if (dtl_rows.size() > 0) {
|
||||
mst_jo.put("bill_status", "30");
|
||||
} else {
|
||||
mst_jo.put("bill_status", "10");
|
||||
}
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void reIssueTask(Map whereJson) {
|
||||
String task_id = (String) whereJson.get("task_id");
|
||||
//判断指令状态,只能下发生成、执行中状态的任务
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("请输入正确的任务号!");
|
||||
}
|
||||
if (!task_jo.getString("task_status").equals("04")) {
|
||||
throw new BadRequestException("只能修改任务状态为未下发的任务!");
|
||||
}
|
||||
// AbstractAcsTask task = new InTask();
|
||||
//调用ACS接受任务接口
|
||||
/* JSONObject result = task.immediateNotifyAcs(task_id);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
String status = result.getString("status");
|
||||
if ("200".equals(status)) {
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
//更新任务指令为下发
|
||||
JSONObject task_map = new JSONObject();
|
||||
task_map.put("task_id", task_id);
|
||||
task.updateTaskStatus(task_map, "1");
|
||||
} else {
|
||||
throw new BadRequestException("任务下发失败:" + result.getString("message"));
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirmTask(Map whereJson) {
|
||||
//判断指令状态,只能下发生成、执行中状态的任务
|
||||
String task_code = (String) whereJson.get("task_code");
|
||||
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_code = '" + task_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(task_jo)) {
|
||||
throw new BadRequestException("请输入正确的任务号!");
|
||||
}
|
||||
/*if (!task_jo.getString("task_status").equals("03")) {
|
||||
throw new BadRequestException("只能修改任务状态为执行中的任务!");
|
||||
}*/
|
||||
|
||||
/* AbstractAcsTask task = new InTask();
|
||||
task.updateTaskStatus(task_jo, TaskStatusEnum.FINISHED.getCode());*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelTask(Map whereJson) {
|
||||
WQLObject dis_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||
WQLObject task_wql = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject dtl_wql = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
||||
|
||||
|
||||
//判断指令状态,只能取消完成状态的任务
|
||||
String task_code = (String) whereJson.get("task_code");
|
||||
/* TaskDto taskDto = taskService.findByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(taskDto)) {
|
||||
throw new BadRequestException("请输入正确的任务号!");
|
||||
}
|
||||
if (!taskDto.getTask_status().equals("99")) {
|
||||
throw new BadRequestException("只能取消任务状态为完成中的任务!");
|
||||
}*/
|
||||
|
||||
//判断主表是否为99,如果为99不允许取消
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
if (mst_jo.getString("bill_status").equals("99")) {
|
||||
throw new BadRequestException("单据已完成,无法进行取消任务操作!");
|
||||
}
|
||||
|
||||
//变更任务状态
|
||||
HashMap task_map = new HashMap();
|
||||
task_map.put("task_status", "01");
|
||||
task_wql.update(task_map, "taskdtl_id = '" + whereJson.get("task_id") + "'");
|
||||
|
||||
//更新实际数量
|
||||
JSONArray dis_rows = dis_wql.query("task_id = '" + whereJson.get("task_id") + "'").getResultJSONArray(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
double real_qty = dis_row.getDoubleValue("real_qty");
|
||||
dis_row.put("real_qty", "0");
|
||||
dis_row.put("work_status", "01");
|
||||
dis_wql.update(dis_row);
|
||||
|
||||
//更新明细实际数量
|
||||
JSONObject dtl_jo = dtl_wql.query("iostorinvdtl_id = '" + dis_row.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
double old_real_qty = dtl_jo.getDoubleValue("real_qty");
|
||||
dtl_jo.put("real_qty", NumberUtil.sub(old_real_qty, real_qty));
|
||||
dtl_wql.update(dtl_jo);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirm(Map whereJson) {
|
||||
@@ -1413,55 +897,112 @@ public class ProductInServiceImpl implements ProductInService {
|
||||
// inbillService.confirmMst(JSONObject.parseObject(JSON.toJSONString(whereJson)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void backConfirm(Map whereJson) {
|
||||
WQLObject dtl_wql = WQLObject.getWQLObject("st_ivt_iostorinvdtl");
|
||||
WQLObject mst_wql = WQLObject.getWQLObject("ST_IVT_IOStorInv");
|
||||
public void confirmDis(JSONObject form) {
|
||||
WQLObject dis_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||
WQLObject dtl_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
||||
String task_id = form.getString("task_id");
|
||||
|
||||
//校验主表状态为生成
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
if (!mst_jo.getString("bill_status").equals("10")) {
|
||||
throw new BadRequestException("主表状态必须为生成!");
|
||||
if (StrUtil.isEmpty(task_id)) {
|
||||
throw new BadRequestException("任务标识为空!");
|
||||
}
|
||||
|
||||
JSONObject mst_row = mst_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").uniqueResult(0);
|
||||
JSONArray dtl_rows = dtl_wql.query("iostorinv_id = '" + whereJson.get("iostorinv_id") + "'").getResultJSONArray(0);
|
||||
JSONArray dis_rows = dis_table.query("task_id = '" + task_id + "'").getResultJSONArray(0);
|
||||
//回写入库分配表实际数量
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
dis_row.put("work_status", "99");
|
||||
dis_table.update(dis_row);
|
||||
|
||||
//生成手工出库单
|
||||
String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + "";
|
||||
String bill_code = CodeUtil.getNewCode("IO_CODE");
|
||||
whereJson.put("iostorinv_id", iostorinv_id);
|
||||
whereJson.put("bill_code", bill_code);
|
||||
whereJson.put("io_type", "1");
|
||||
whereJson.put("bill_type", "010601");
|
||||
whereJson.put("buss_type", ((String) whereJson.get("bill_type")).substring(0, 4));
|
||||
mst_wql.insert(whereJson);
|
||||
for (int i = 0; i < dtl_rows.size(); i++) {
|
||||
JSONObject dtl_row = dtl_rows.getJSONObject(i);
|
||||
dtl_row.put("source_billdtl_id", dtl_row.getString("iostorinvdtl_id"));
|
||||
dtl_row.put("source_bill_type", mst_row.getString("bill_type"));
|
||||
dtl_row.put("source_bill_code", mst_row.getString("bill_code"));
|
||||
dtl_row.put("source_bill_table", "ST_IVT_IOStorInvDtl");
|
||||
dtl_row.put("iostorinvdtl_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
dtl_row.put("iostorinv_id", iostorinv_id);
|
||||
dtl_row.put("bill_status", "10");
|
||||
dtl_wql.insert(dtl_row);
|
||||
JSONObject dtl_row = dtl_table.query("iostorinvdtl_id = '" + dis_row.getString("iostorinvdtl_id") + "'").uniqueResult(0);
|
||||
//该明细下的所有分配明细都执行完成且未分配数=0,将明细变为99
|
||||
JSONArray unfinish_dis = dis_table.query("iostorinvdtl_id = '" + dis_row.getString("iostorinvdtl_id") + "' AND work_status < '99'").getResultJSONArray(0);
|
||||
if (dtl_row.getDoubleValue("unassign_qty") == 0 && unfinish_dis.size() <= 0) {
|
||||
dtl_row.put("bill_status", "99");
|
||||
}
|
||||
dtl_table.update(dtl_row);
|
||||
|
||||
//判断主表是否改为完成
|
||||
JSONArray dtl_rows = dtl_table.query("iostorinv_id = '" + dtl_row.getString("iostorinv_id") + "' AND bill_status < '99'").getResultJSONArray(0);
|
||||
if (dtl_rows.size() == 0) {
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("iostorinv_id", dtl_row.getString("iostorinv_id"));
|
||||
this.confirmMst(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void confirmMst(JSONObject from) {
|
||||
WQLObject dtl_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDtl");
|
||||
WQLObject dis_table = WQLObject.getWQLObject("ST_IVT_IOStorInvDis");
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||
String iostorinv_id = from.getString("iostorinv_id");
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
mst_row.put("bill_status", "99");
|
||||
mst_row.put("confirm_optid", currentUserId);
|
||||
mst_row.put("confirm_optname", nickName);
|
||||
mst_row.put("confirm_time", now);
|
||||
//更新主表状态为99
|
||||
mst_wql.update(mst_row);
|
||||
JSONObject mst_jo = WQLObject.getWQLObject("ST_IVT_IOStorInv").query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("bill_status", "99");
|
||||
dtl_wql.update(map, "iostorinv_id = '" + mst_row.get("iostorinv_id") + "'");
|
||||
//查询
|
||||
JSONArray dtl_rows = dtl_table.query("iostorinv_id = '" + iostorinv_id + "' AND bill_status < '99'").getResultJSONArray(0);
|
||||
|
||||
if (dtl_rows.size() > 0) {
|
||||
throw new BadRequestException("主表下存在未完成的明细!");
|
||||
}
|
||||
|
||||
//更新目的点位,仓位、加库存
|
||||
JSONArray dis_rows = dis_table.query("iostorinv_id = '" + iostorinv_id + "'").getResultJSONArray(0);
|
||||
for (int i = 0; i < dis_rows.size(); i++) {
|
||||
JSONObject dis_row = dis_rows.getJSONObject(i);
|
||||
|
||||
//更新终点
|
||||
JSONObject jsonPoint1 = pointTab.query("point_id = '" + dis_row.getString("struct_id") + "'").uniqueResult(0);
|
||||
jsonPoint1.put("vehicle_code", dis_row.getString("storagevehicle_code"));
|
||||
jsonPoint1.put("lock_type", "1");
|
||||
jsonPoint1.put("point_status", "2");
|
||||
pointTab.update(jsonPoint1);
|
||||
// 判断此物料是否占用了两个货位
|
||||
JSONObject jsonMater = materTab.query("material_id = '" + dis_row.getString("material_id") + "'").uniqueResult(0);
|
||||
|
||||
String length_up = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("MATERIAL_LENGTH_UP").getValue();
|
||||
double material_length = jsonMater.getDoubleValue("length");
|
||||
double material_length_up = Double.valueOf(length_up);
|
||||
|
||||
if (material_length > material_length_up) {
|
||||
// 找对应货位并更新
|
||||
JSONObject jsonPoint2 = pointTab.query("point_id = '" + jsonPoint1.getString("control_point") + "'").uniqueResult(0);
|
||||
jsonPoint2.put("vehicle_code", dis_row.getString("storagevehicle_code"));
|
||||
jsonPoint2.put("lock_type", "1");
|
||||
jsonPoint2.put("point_status", "2");
|
||||
pointTab.update(jsonPoint2);
|
||||
}
|
||||
|
||||
//加库存
|
||||
JSONObject i_form = new JSONObject();
|
||||
i_form.put("struct_id", dis_row.getString("struct_id"));
|
||||
i_form.put("material_id", dis_row.getString("material_id"));
|
||||
i_form.put("quality_scode", dis_row.getString("quality_scode"));
|
||||
i_form.put("pcsn", dis_row.getString("pcsn"));
|
||||
i_form.put("change_qty", dis_row.getString("plan_qty"));
|
||||
i_form.put("bill_type_scode", mst_jo.getString("bill_type"));
|
||||
i_form.put("inv_id", mst_jo.getString("iostorinv_id"));
|
||||
i_form.put("bill_code", mst_jo.getString("bill_code"));
|
||||
i_form.put("bill_table", "ST_IVT_IOStorInv");
|
||||
i_form.put("qty_unit_id", dis_row.getString("qty_unit_id"));
|
||||
i_form.put("qty_unit_name", dis_row.getString("qty_unit_name"));
|
||||
storPublicService.IOStor(i_form, "33");
|
||||
|
||||
}
|
||||
mst_jo.put("bill_status", "99");
|
||||
mst_jo.put("confirm_optid", currentUserId);
|
||||
mst_jo.put("confirm_optname", nickName);
|
||||
mst_jo.put("confirm_time", now);
|
||||
|
||||
//更新主表状态为99
|
||||
WQLObject.getWQLObject("ST_IVT_IOStorInv").update(mst_jo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
输入.bill_type TYPEAS s_string
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.iostorinvdtl_id TYPEAS s_string
|
||||
输入.iostorinv_id TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -102,6 +103,10 @@
|
||||
mst.bill_code = 输入.bill_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.iostorinv_id <> ""
|
||||
mst.iostorinv_id = 输入.iostorinv_id
|
||||
ENDOPTION
|
||||
|
||||
order by dtl.seq_no ASC
|
||||
|
||||
ENDSELECT
|
||||
@@ -127,6 +132,36 @@
|
||||
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
||||
ENDOPTION
|
||||
|
||||
order by dis.seq_no ASC
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
dis.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
point.point_code,
|
||||
task.point_code1,
|
||||
task.point_code2,
|
||||
task.task_code,
|
||||
task.task_type
|
||||
FROM
|
||||
ST_IVT_IOStorInvDis dis
|
||||
LEFT JOIN sch_base_point point ON point.point_id = dis.point_id
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = dis.material_id
|
||||
LEFT JOIN sch_base_task task ON task.task_id = dis.task_id
|
||||
WHERE
|
||||
1=1
|
||||
|
||||
OPTION 输入.iostorinvdtl_id <> ""
|
||||
dis.iostorinvdtl_id = 输入.iostorinvdtl_id
|
||||
ENDOPTION
|
||||
|
||||
order by dis.seq_no ASC
|
||||
|
||||
ENDSELECT
|
||||
|
||||
@@ -274,7 +274,7 @@ export default {
|
||||
},
|
||||
clcikRow(row, column, event) {
|
||||
this.form.dtl_row = row
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
this.form.dtl_row = res[row.index]
|
||||
})
|
||||
@@ -361,7 +361,7 @@ export default {
|
||||
return
|
||||
}
|
||||
crudProductIn.confirmvehicle(this.dis_row).then(res => {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code }).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
@@ -370,27 +370,6 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
deleteRow(index, rows) {
|
||||
// 如果桶状态不是生成调后台逻辑
|
||||
if (rows[index].status !== '01') {
|
||||
crudProductIn.deleteDisDtl(rows[index]).then(res => {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
this.form.tableMater = res
|
||||
})
|
||||
rows[index].pop = false
|
||||
}).catch(err => {
|
||||
rows[index].pop = false
|
||||
return
|
||||
})
|
||||
}
|
||||
this.form.dtl_row.assign_qty = parseFloat(this.form.dtl_row.assign_qty) - parseFloat(rows[index].storage_qty)
|
||||
this.form.dtl_row.unassign_qty = parseFloat(this.form.dtl_row.unassign_qty) + parseFloat(rows[index].storage_qty)
|
||||
this.openParam.splice(this.form.dtl_row.index, 1, this.form.dtl_row)
|
||||
rows.splice(index, 1)
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
this.sectProp = val
|
||||
if (val.length === 1) {
|
||||
@@ -419,29 +398,23 @@ export default {
|
||||
this.form.tableMater.splice(i, 1, this.form.tableMater[i]) // 通过splice 替换数据 触发视图更新
|
||||
}
|
||||
crudProductIn.divStruct(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
this.form.tableMater = []
|
||||
})
|
||||
},
|
||||
bucketChange(row) {
|
||||
this.bucketObj = row
|
||||
this.form.bucketunique = row.bucketunique
|
||||
this.form.storage_qty = row.storage_qty
|
||||
},
|
||||
divPoint() {
|
||||
if (!this.form.point_code) {
|
||||
this.crud.notify('请选择入库点', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
debugger
|
||||
if (this.form.tableMater.length === 0) {
|
||||
this.crud.notify('请先选择一条明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
crudProductIn.divPoint(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
@@ -466,7 +439,7 @@ export default {
|
||||
this.form.stor_id = this.stor_id
|
||||
this.form.is_pc = '1'
|
||||
crudProductIn.divStruct(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
@@ -482,9 +455,6 @@ export default {
|
||||
this.$refs.child.getMsg(false)
|
||||
}
|
||||
},
|
||||
doCancel(data) {
|
||||
data.pop = false
|
||||
},
|
||||
unDivStruct() {
|
||||
if (this.form.tableMater.length <= 0) {
|
||||
this.crud.notify('不存在载具明细!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
@@ -497,7 +467,7 @@ export default {
|
||||
}
|
||||
// 如果勾选了,直接跳后台
|
||||
crudProductIn.unDivStruct(this.form).then(res => {
|
||||
crudProductIn.getIODtl({ 'bill_code': this.form.dtl_row.bill_code, 'open_flag': '1' }).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.dtl_row.iostorinv_id, 'open_flag': '1' }).then(res => {
|
||||
this.openParam = res
|
||||
})
|
||||
crudProductIn.getDisDtl(this.form.dtl_row).then(res => {
|
||||
@@ -505,37 +475,6 @@ export default {
|
||||
this.crud.notify('取消分配成功!', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
})
|
||||
})
|
||||
},
|
||||
dialogBucket() {
|
||||
if (!this.form.dtl_row) {
|
||||
this.crud.notify('请选择一条入库明细', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
/* const material_dtl_scode = this.form.dtl_row.material_dtl_scode
|
||||
let type = ''
|
||||
if (material_dtl_scode.slice(0, 4) === '0903') {
|
||||
type = '01'
|
||||
}
|
||||
if (material_dtl_scode.slice(0, 4) === '0904') {
|
||||
type = '02'
|
||||
}
|
||||
if (material_dtl_scode.slice(0, 6) === '090202') {
|
||||
type = '04'
|
||||
}
|
||||
if (material_dtl_scode.slice(0, 6) === '090201') {
|
||||
type = '03'
|
||||
}*/
|
||||
const bucket = {
|
||||
'material_code': this.form.dtl_row.material_code,
|
||||
'pcsn': this.form.dtl_row.pcsn,
|
||||
'quality_scode': this.form.dtl_row.quality_scode,
|
||||
'ivt_level': this.form.dtl_row.ivt_level,
|
||||
'is_active': this.form.dtl_row.is_active,
|
||||
// 'storagevehicle_type': type,
|
||||
'bucket_status': '01'
|
||||
}
|
||||
this.bucketProp = bucket
|
||||
this.bucketShow = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,268 +0,0 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
title="任务修改"
|
||||
append-to-body
|
||||
:visible.sync="dialogVisible"
|
||||
destroy-on-close
|
||||
fullscreen
|
||||
width="1000px"
|
||||
@close="close"
|
||||
@open="open"
|
||||
>
|
||||
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="20" style="border: 1px solid white">
|
||||
<span />
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<span>
|
||||
<el-button icon="el-icon-check" size="mini" :loading="crud.cu === 2" type="primary" @click="submit">确定</el-button>
|
||||
<el-button icon="el-icon-close" size="mini" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form ref="taskForm" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form-item label="任务号" prop="task_code">
|
||||
<label slot="label">任 务 号:</label>
|
||||
<el-input v-model="form.task_code" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="存储载具" prop="storagevehicle_code">
|
||||
<el-input v-model="form.storagevehicle_code" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="原入库点" prop="point_code">
|
||||
<el-input v-model="form.point_code" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="入库点" prop="new_point_code">
|
||||
<label slot="label">入 库 点:</label>
|
||||
<el-select
|
||||
v-model="form.new_point_code"
|
||||
clearable
|
||||
placeholder="请选择"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in pointlist"
|
||||
:key="item.point_code"
|
||||
:label="item.point_code"
|
||||
:value="item.point_code"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="原货位" prop="struct_code">
|
||||
<label slot="label">原 货 位:</label>
|
||||
<el-input v-model="form.struct_code" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="新货位" prop="new_struct_code">
|
||||
<label slot="label">新 货 位:</label>
|
||||
<el-input v-model="form.new_struct_code" disabled style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属库区" prop="new_struct_code">
|
||||
<el-cascader
|
||||
v-model="query.sect"
|
||||
style="width: 210px"
|
||||
placeholder="所属库区"
|
||||
:options="sects"
|
||||
:props="{ checkStrictly: true }"
|
||||
clearable
|
||||
@change="sectQueryChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="模糊查询" prop="struct_code">
|
||||
<el-input
|
||||
v-model="query.search"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
size="mini"
|
||||
placeholder="输入货位编码、名称"
|
||||
prefix-icon="el-icon-search"
|
||||
class="filter-item"
|
||||
/>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
|
||||
<!--表格渲染-->
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
:data="crud.data"
|
||||
style="width: 100%"
|
||||
:row-class-name="tableRowClassName"
|
||||
highlight-current-row
|
||||
border
|
||||
:header-cell-style="{background:'#f5f7fa',color:'#606266'}"
|
||||
@row-click="clcikRow"
|
||||
@select="handleSelectionChange"
|
||||
@select-all="onSelectAll"
|
||||
>
|
||||
<el-table-column prop="struct_code" label="货位编码" />
|
||||
<el-table-column prop="struct_name" label="货位名称" />
|
||||
<el-table-column prop="material_height_type_name" label="高度类型" />
|
||||
<el-table-column prop="sect_name" label="库区名称" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import CRUD, { header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
// import crudStructattr from '@/views/wms/basedata/st/struct/structattr'
|
||||
// import crudSectattr from '@/views/wms/basedata/st/sect/sectattr'
|
||||
import crudProductIn from '@/views/wms/st/productIn/productin'
|
||||
import crudPoint from '@/views/wms/sch/point'
|
||||
|
||||
export default {
|
||||
name: 'StructDiv',
|
||||
components: { crudOperation, rrOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({
|
||||
title: '仓位',
|
||||
optShow: {},
|
||||
url: 'api/structattr',
|
||||
idField: 'struct_id',
|
||||
sort: 'struct_id,desc',
|
||||
crudMethod: { ...crudStructattr }
|
||||
})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
sectProp: {
|
||||
type: Object,
|
||||
default: null
|
||||
},
|
||||
bucketForm: {
|
||||
type: Object,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sects: [],
|
||||
classes: [],
|
||||
pointlist: [],
|
||||
dialogVisible: false,
|
||||
// sectProp: null,
|
||||
checkrow: {},
|
||||
form: {
|
||||
task_id: '',
|
||||
task_code: '',
|
||||
storagevehicle_code: '',
|
||||
point_code: '',
|
||||
new_point_code: '',
|
||||
struct_code: '',
|
||||
new_struct_code: ''
|
||||
},
|
||||
rows: []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dialogShow: {
|
||||
handler(newValue, oldValue) {
|
||||
this.dialogVisible = newValue
|
||||
}
|
||||
},
|
||||
sectProp: {
|
||||
handler(newValue, oldValue) {
|
||||
this.sectProp = newValue
|
||||
}
|
||||
},
|
||||
bucketForm: {
|
||||
handler(newValue, oldValue) {
|
||||
this.form = newValue
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.crud.query.lock_type = '1'
|
||||
},
|
||||
open() {
|
||||
crudSectattr.getSect({ 'is_materialstore': '1', 'sect_type_attr': '00' }).then(res => {
|
||||
this.sects = res.content
|
||||
})
|
||||
crudPoint.getPoint({ 'area_type': '21' }).then(res => {
|
||||
this.pointlist = res
|
||||
})
|
||||
if (this.sectProp) {
|
||||
this.query.sect = this.sectProp
|
||||
if (this.sectProp.length === 1) {
|
||||
this.query.stor_id = this.sectProp[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (this.sectProp.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (this.sectProp.length === 2) {
|
||||
this.query.stor_id = this.sectProp[0]
|
||||
this.query.sect_id = this.sectProp[1]
|
||||
}
|
||||
}
|
||||
this.crud.toQuery()
|
||||
},
|
||||
clcikRow(row, column, event) {
|
||||
this.form.new_struct_code = row.struct_code
|
||||
},
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
row.index = rowIndex
|
||||
},
|
||||
sectQueryChange(val) {
|
||||
if (val.length === 1) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = ''
|
||||
}
|
||||
if (val.length === 0) {
|
||||
this.query.sect_id = ''
|
||||
this.query.stor_id = ''
|
||||
}
|
||||
if (val.length === 2) {
|
||||
this.query.stor_id = val[0]
|
||||
this.query.sect_id = val[1]
|
||||
}
|
||||
},
|
||||
handleSelectionChange(val, row) {
|
||||
if (val.length > 1) {
|
||||
this.$refs.table.clearSelection()
|
||||
this.$refs.table.toggleRowSelection(val.pop())
|
||||
} else {
|
||||
this.checkrow = row
|
||||
}
|
||||
},
|
||||
onSelectAll() {
|
||||
this.$refs.table.clearSelection()
|
||||
},
|
||||
close() {
|
||||
this.crud.resetQuery()
|
||||
this.query.sect = null
|
||||
this.$emit('update:dialogShow', false)
|
||||
},
|
||||
submit() {
|
||||
this.crud.resetQuery()
|
||||
crudProductIn.updateTask(this.form).then(res => {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('updateCommit', this.checkrow)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-dialog__body {
|
||||
padding-top: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -13,35 +13,37 @@
|
||||
<label slot="label">单 据 号:</label>
|
||||
<el-input v-model="form.bill_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="仓库" prop="stor_id">
|
||||
<label slot="label">仓 库:</label>
|
||||
<el-form-item label="生产区域">
|
||||
<el-select
|
||||
v-model="form.stor_id"
|
||||
v-model="form.product_code"
|
||||
clearable
|
||||
placeholder="仓库"
|
||||
class="filter-item"
|
||||
style="width: 210px"
|
||||
size="mini"
|
||||
placeholder="全部"
|
||||
:disabled="true"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in storlist"
|
||||
:key="item.stor_id"
|
||||
:label="item.stor_name"
|
||||
:value="item.stor_id"
|
||||
v-for="item in dict.product_area"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bill_type">
|
||||
<el-form-item label="业务类型">
|
||||
<el-select
|
||||
v-model="form.bill_type"
|
||||
clearable
|
||||
placeholder="业务类型"
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
filterable
|
||||
size="mini"
|
||||
:disabled="true"
|
||||
placeholder="业务类型"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.INANDOUT_BILL_TYPE"
|
||||
v-for="item in dict.ST_INV_IN_TYPE"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -58,7 +60,7 @@
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.io_bill_status"
|
||||
v-for="item in dict.IO_BILL_STATUS"
|
||||
:key="item.id"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
@@ -105,16 +107,12 @@
|
||||
@current-change="handleDtlCurrentChange"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="bill_code" label="单据号" align="center" />
|
||||
<el-table-column :formatter="bill_statusFormat" prop="bill_status" label="状态" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="pcsn" label="子卷号" width="150" align="center" />
|
||||
<el-table-column prop="sap_pcsn" label="SAP批次号" width="150" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
|
||||
<el-table-column prop="pcsn" label="订单号" width="150" align="center" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="qty_unit_name" label="单位" align="center" />
|
||||
<el-table-column prop="source_bill_type" label="源单类型" align="center" width="130px" :formatter="invtypeFormat" />
|
||||
<el-table-column prop="source_bill_code" label="源单号" align="center" width="130px" />
|
||||
<el-table-column show-overflow-tooltip prop="remark" label="明细备注" align="center" />
|
||||
</el-table>
|
||||
</el-card>
|
||||
@@ -136,12 +134,11 @@
|
||||
>
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_code" label="物料编码" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_name" label="物料名称" align="center" />
|
||||
<el-table-column prop="pcsn" label="子卷号" align="center" width="150"/>
|
||||
<el-table-column prop="sap_pcsn" label="SAP批次号" align="center" />
|
||||
<el-table-column prop="box_no" label="载具号" align="center" />
|
||||
<el-table-column min-width="120" show-overflow-tooltip prop="material_spec" label="物料规格" align="center" />
|
||||
<el-table-column prop="pcsn" label="订单号" align="center" width="150" />
|
||||
<el-table-column prop="plan_qty" :formatter="crud.formatNum3" label="重量" align="center" />
|
||||
<el-table-column prop="next_point_code" label="起始位置" align="center" />
|
||||
<el-table-column prop="struct_code" label="目的位置" align="center" />
|
||||
<el-table-column prop="point_code1" label="起始位置" align="center" />
|
||||
<el-table-column prop="point_code2" label="目的位置" align="center" />
|
||||
<el-table-column prop="task_code" label="任务号" align="center" />
|
||||
<el-table-column prop="task_type_name" label="任务类型" align="center" width="150px" />
|
||||
</el-table>
|
||||
@@ -152,14 +149,13 @@
|
||||
<script>
|
||||
|
||||
import { crud } from '@crud/crud'
|
||||
// import checkoutbill from '@/views/wms/st/outbill/checkoutbill'
|
||||
// import crudUserStor from '@/views/wms/basedata/st/userStor/userStor'
|
||||
import crudProductIn from '@/views/wms/st/productIn/productin'
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
components: { },
|
||||
mixins: [crud()],
|
||||
dicts: ['io_bill_status', 'work_status', 'task_status', 'SCH_TASK_TYPE_DTL', 'INANDOUT_BILL_TYPE'],
|
||||
dicts: ['ST_INV_IN_TYPE', 'product_area', 'IO_BILL_STATUS'],
|
||||
props: {
|
||||
dialogShow: {
|
||||
type: Boolean,
|
||||
@@ -193,14 +189,6 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
checkoutbill.getInvTypes().then(res => {
|
||||
this.billtypelist = res
|
||||
})
|
||||
crudUserStor.getUserStor().then(res => {
|
||||
this.storlist = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
this.queryTableDtl()
|
||||
@@ -213,8 +201,8 @@ export default {
|
||||
this.tabledis = []
|
||||
this.$emit('TaskChanged')
|
||||
},
|
||||
bill_statusFormat(row) {
|
||||
return this.dict.label.io_bill_status[row.bill_status]
|
||||
stateFormat(row, column) {
|
||||
return this.dict.label.IO_BILL_STATUS[row.bill_status]
|
||||
},
|
||||
taskdtl_typeFormat(row) {
|
||||
return this.dict.label.SCH_TASK_TYPE_DTL[row.taskdtl_type]
|
||||
@@ -246,13 +234,14 @@ export default {
|
||||
this.currentDis = current
|
||||
},
|
||||
queryTableDtl() {
|
||||
checkoutbill.getOutBillDtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||
crudProductIn.getIODtl({ 'iostorinv_id': this.form.iostorinv_id }).then(res => {
|
||||
this.tableDtl = res
|
||||
})
|
||||
},
|
||||
queryTableDdis() {
|
||||
if (this.currentdtl !== null) {
|
||||
checkoutbill.getOutBillTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
|
||||
crudProductIn.getDisTask({ 'iostorinvdtl_id': this.currentdtl.iostorinvdtl_id }).then(res => {
|
||||
debugger
|
||||
this.tabledis = res
|
||||
}).catch(() => {
|
||||
this.tabledis = []
|
||||
|
||||
@@ -32,14 +32,6 @@ export function getType(params) {
|
||||
})
|
||||
}
|
||||
|
||||
export function getBillDtl(params) {
|
||||
return request({
|
||||
url: '/api/in/productIn/getBillDtl',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
export function getIODtl(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/getIODtl',
|
||||
@@ -80,14 +72,6 @@ export function confirmvehicle(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function deleteDisDtl(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/deleteDisDtl',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getDisDtl(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/getDisDtl',
|
||||
@@ -120,14 +104,6 @@ export function divPoint(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function queryTask(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/queryTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function bucketDtl(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/bucketDtl',
|
||||
@@ -144,22 +120,6 @@ export function updateTask(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function delTask(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/delTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function reIssueTask(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/reIssueTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function confirmTask(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/confirmTask',
|
||||
@@ -168,14 +128,6 @@ export function confirmTask(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function cancelTask(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/cancelTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function confirm(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/confirm',
|
||||
@@ -184,14 +136,6 @@ export function confirm(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export function backConfirm(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/backConfirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function delDis(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/delDis',
|
||||
@@ -215,6 +159,14 @@ export function queryStor() {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getType, getBillDtl, insertDtl, getIODtl, commit, checkVehicle,
|
||||
confirmvehicle, deleteDisDtl, getDisDtl, divStruct, unDivStruct, divPoint, delDis, queryBoxMater,
|
||||
queryTask, bucketDtl, updateTask, delTask, reIssueTask, confirmTask, cancelTask, confirm, backConfirm, queryStor }
|
||||
export function getDisTask(data) {
|
||||
return request({
|
||||
url: '/api/in/productIn/getDisTask',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, getType, insertDtl, getIODtl, commit, checkVehicle,
|
||||
confirmvehicle, getDisDtl, divStruct, unDivStruct, divPoint, delDis, queryBoxMater,
|
||||
bucketDtl, updateTask, confirmTask, confirm, queryStor, getDisTask }
|
||||
|
||||
Reference in New Issue
Block a user