成品区出库
This commit is contained in:
@@ -17,7 +17,7 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.TaskService;
|
||||
import org.nl.wms.sch.tasks.callEmpty.GjxCallEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.callEmpty.YqxCallEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.callMaterial.YqxCallMaterial;
|
||||
import org.nl.wms.sch.tasks.callMaterial.YqxCallMaterialTask;
|
||||
import org.nl.wms.sch.tasks.sendEmpty.HtSendEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.sendEmpty.YqxSendEmpVehicleTask;
|
||||
import org.nl.wms.sch.tasks.sendMaterial.GjxSendMaterialTask;
|
||||
@@ -231,7 +231,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
param.put("vehicle_type", vehicle_type);
|
||||
param.put("vehicle_code", vehicle_code);
|
||||
// 创建任务
|
||||
YqxCallMaterial taskBean = SpringContextHolder.getBean(YqxCallMaterial.class);
|
||||
YqxCallMaterialTask taskBean = SpringContextHolder.getBean(YqxCallMaterialTask.class);
|
||||
String task_id = taskBean.createTask(param);
|
||||
|
||||
} else if (StrUtil.equals(type, "5")) {
|
||||
|
||||
@@ -31,8 +31,8 @@ import java.util.List;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class YqxCallMaterial extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = YqxCallMaterial.class.getName();
|
||||
public class YqxCallMaterialTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = YqxCallMaterialTask.class.getName();
|
||||
|
||||
|
||||
@Override
|
||||
@@ -262,10 +262,6 @@ public class YqxCallMaterial extends AbstractAcsTask {
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj))
|
||||
this.updateTaskStatus(taskObj,"0");
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -0,0 +1,232 @@
|
||||
package org.nl.wms.sch.tasks.cpOut;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
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;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.wms.sch.SchTaskDto;
|
||||
import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.tasks.AcsTaskDto;
|
||||
import org.nl.wms.util.IdUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
*成品出库
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CpOutTask extends AbstractAcsTask {
|
||||
private final String THIS_CLASS = CpOutTask.class.getName();
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject task, String status) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO");
|
||||
|
||||
String task_id = task.getString("task_id");
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "'").uniqueResult(0);
|
||||
|
||||
//任务取消
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 取消删除任务
|
||||
if (StrUtil.equals(taskObj.getString("task_status"), TaskStatusEnum.FINISHED.getCode())) {
|
||||
throw new BadRequestException("已完成不能取消!");
|
||||
}
|
||||
String point_code2 = taskObj.getString("point_code2");
|
||||
String point_code3 = taskObj.getString("point_code3");
|
||||
//说明未二次申请过
|
||||
if (ObjectUtil.isEmpty(point_code3)) {
|
||||
JSONObject json = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);
|
||||
json.put("lock_type", "1");
|
||||
pointTab.update(json);
|
||||
}
|
||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
taskObj.put("remark", "已取消");
|
||||
taskTab.update(taskObj);
|
||||
}
|
||||
|
||||
if ("1".equals(status)) {
|
||||
// 更新任务状态为执行中
|
||||
taskObj.put("task_status", TaskStatusEnum.EXECUTING.getCode());
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskObj.put("car_no", taskObj.getString("car_no"));
|
||||
taskTab.update(taskObj);
|
||||
}
|
||||
|
||||
if (StrUtil.equals(status, "2")) {
|
||||
// 更改任务状态为完成
|
||||
taskObj.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
// 任务表的点位1
|
||||
String point_code1 = taskObj.getString("point_code1"); // 起点编码
|
||||
JSONObject point1Obj = pointTab.query("point_code = '" + point_code1 + "'").uniqueResult(0);// 起点
|
||||
|
||||
//table_fk_id = 单据id
|
||||
JSONObject regionIoObject = regionIoTab.query("iostorinv_id = '" + taskObj.getString("table_fk_id") + "'").uniqueResult(0);
|
||||
|
||||
String point_code2 = taskObj.getString("point_code2"); // 终点编码:出库点位
|
||||
JSONObject point2Obj = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0);// 终点
|
||||
|
||||
// 修改区域出入库 - 起点点位解锁、点位状态更新 - 终点解锁、更新状态
|
||||
//区域出入表【st_ivt_regionIO】
|
||||
regionIoObject.put("end_point_code", point_code2);
|
||||
regionIoObject.put("start_region_id", point1Obj.getString("region_id")); // 终点区域
|
||||
regionIoObject.put("end_region_id", point2Obj.getString("region_id")); // 终点区域
|
||||
regionIoObject.put("bill_status", "3"); // 单据状态
|
||||
regionIoObject.put("task_id", task_id); // 任务id
|
||||
regionIoTab.update(regionIoObject);
|
||||
|
||||
//完成后将仓位库存删掉
|
||||
//仓位库存表【ST_IVT_StructIvt】
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_StructIvt");
|
||||
ivtTab.delete("point_code = '" + taskObj.getString("point_code1") + "'");
|
||||
|
||||
// 点位解锁 并设置空位
|
||||
point1Obj.put("lock_type", "1");
|
||||
point1Obj.put("point_status", "1");
|
||||
point2Obj.put("lock_type", "1");
|
||||
point2Obj.put("point_status", "1");
|
||||
pointTab.update(point1Obj);
|
||||
pointTab.update(point2Obj);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void findNextPoint() {
|
||||
/*
|
||||
* 根据业务找对应的终点
|
||||
*/
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); // 点位表
|
||||
JSONArray taskArr = taskTab.query("handle_class = '" + THIS_CLASS + "'and is_delete = '0' and task_status = '" + TaskStatusEnum.SURE_END.getCode() + "'").getResultJSONArray(0);
|
||||
for (int i = 0; i < taskArr.size(); i++) {
|
||||
JSONObject taskObj = taskArr.getJSONObject(i);
|
||||
String material_id = taskObj.getString("material_id");
|
||||
JSONObject param1 = new JSONObject();
|
||||
param1.put("flag", "1");
|
||||
param1.put("material_id", material_id);
|
||||
param1.put("region_code", "CPCKQ01");
|
||||
//1、找空位的终点
|
||||
JSONObject endPoint = WQL.getWO("QSCH_cpOut_01").addParamMap(param1).process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(endPoint)) {
|
||||
// 找到终点,上锁
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
taskObj.put("point_code2", endPoint.getString("point_code"));
|
||||
taskObj.put("task_status", TaskStatusEnum.START_AND_POINT.getCode());
|
||||
taskTab.update(taskObj);
|
||||
|
||||
//锁住终点
|
||||
endPoint.put("task_id", taskObj.getString("task_id"));
|
||||
endPoint.put("lock_type", "2");
|
||||
pointTab.update(endPoint);
|
||||
} else {
|
||||
taskObj.put("remark", "成品出库区无可用货位");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
}
|
||||
|
||||
taskTab.update(taskObj);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AcsTaskDto> addTask() {
|
||||
/*
|
||||
* 下发给ACS时需要特殊处理
|
||||
*/
|
||||
JSONArray arr = WQLObject.getWQLObject("SCH_BASE_Task").query("handle_class = '" + THIS_CLASS + "' and task_status = '" + TaskStatusEnum.START_AND_POINT.getCode() + "' and is_delete ='0'").getResultJSONArray(0);
|
||||
|
||||
ArrayList<AcsTaskDto> acsTaskArr = new ArrayList<>();
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
AcsTaskDto dto = AcsTaskDto.builder()
|
||||
.task_id(json.getString("task_id"))
|
||||
.task_code(json.getString("task_code"))
|
||||
.task_type(json.getString("acs_task_type"))
|
||||
.start_device_code(json.getString("point_code1"))
|
||||
.next_device_code(json.getString("point_code3"))
|
||||
.vehicle_code(json.getString("vehicle_code"))
|
||||
.vehicle_type(json.getString("vehicle_type"))
|
||||
.priority(json.getString("priority"))
|
||||
.remark(json.getString("remark"))
|
||||
.build();
|
||||
acsTaskArr.add(dto);
|
||||
}
|
||||
return acsTaskArr;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String createTask(JSONObject whereJson) {
|
||||
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO");
|
||||
String point_code1 = whereJson.getString("point_code1"); // 起点
|
||||
String vehicle_type = whereJson.getString("vehicle_type");
|
||||
String vehicle_code = whereJson.getString("vehicle_code");
|
||||
String iostorinv_id = whereJson.getString("iostorinv_id");
|
||||
|
||||
SchTaskDto dto = SchTaskDto.builder()
|
||||
.task_id(IdUtil.getLongId())
|
||||
.task_code(CodeUtil.getNewCode("TASK_CODE"))
|
||||
.task_type("task_type")
|
||||
.task_name("成品区出库")
|
||||
.task_status(TaskStatusEnum.SURE_END.getCode())
|
||||
.point_code1(point_code1)
|
||||
.vehicle_code(vehicle_code)
|
||||
.vehicle_type(vehicle_type)
|
||||
.handle_class(THIS_CLASS)
|
||||
.create_time(DateUtil.now())
|
||||
.request_param(whereJson.toJSONString())
|
||||
.table_name("st_ivt_regionIO")
|
||||
.table_fk("iostorinv_id")
|
||||
.table_fk_id(Long.valueOf(iostorinv_id))
|
||||
.build();
|
||||
//任务表【SCH_BASE_Task】
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
taskTab.insert(json);
|
||||
|
||||
// 单据设置执行中
|
||||
JSONObject iostorinv = regionIoTab.query("iostorinv_id = '" + iostorinv_id + "'").uniqueResult(0);
|
||||
iostorinv.put("bill_status", "2");
|
||||
regionIoTab.update(iostorinv);
|
||||
|
||||
//创建好立即下发
|
||||
this.immediateNotifyAcs();
|
||||
return String.valueOf(dto.getTask_id());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceFinish(String task_id) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + task_id + "' and is_delete = '0' and task_status <> " + TaskStatusEnum.FINISHED.getCode()).uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(taskObj))
|
||||
this.updateTaskStatus(taskObj,"2");
|
||||
else {
|
||||
throw new BadRequestException("未找到该任务或者任务已完成");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancel(String task_id) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
[交易说明]
|
||||
交易名: 成品出库
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.region_code TYPEAS s_string
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
SCH_BASE_Point
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND is_delete = '0'
|
||||
AND lock_type = '1'
|
||||
AND is_used = '1'
|
||||
AND point_status = '1'
|
||||
OPTION 输入.region_code <> ""
|
||||
region_code = 输入.region_code
|
||||
ENDOPTION
|
||||
ORDER BY point_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.bill.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.wms.st.bill.service.RegionIoService;
|
||||
import org.nl.wms.st.bill.service.dto.RegionIoDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -60,4 +61,13 @@ public class RegionIoController {
|
||||
regionioService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/makeTask")
|
||||
@Log("生成任务")
|
||||
@ApiOperation("生成任务")
|
||||
//@SaCheckPermission("@el.check('regionio:add')")
|
||||
public ResponseEntity<Object> makeTask(@RequestBody JSONArray dto){
|
||||
regionioService.makeTask(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,4 +64,9 @@ public interface RegionIoService {
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 生成任务
|
||||
* @param dto
|
||||
*/
|
||||
void makeTask(JSONArray dto);
|
||||
}
|
||||
|
||||
@@ -4,7 +4,10 @@ import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
import org.nl.wms.sch.service.RegionService;
|
||||
import org.nl.wms.sch.tasks.cpOut.CpOutTask;
|
||||
import org.nl.wms.sch.tasks.sendMaterial.HkxSendMaterialTask;
|
||||
import org.nl.wms.st.bill.service.RegionIoService;
|
||||
import org.nl.wms.st.bill.service.dto.RegionIoDto;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -137,5 +140,28 @@ public class RegionIoServiceImpl implements RegionIoService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成任务
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@Override
|
||||
public void makeTask(JSONArray dto) {
|
||||
WQLObject regionIoTab = WQLObject.getWQLObject("st_ivt_regionIO");
|
||||
for (int i = 0; i < dto.size(); i++) {
|
||||
JSONObject dtoJSONObject = dto.getJSONObject(i);
|
||||
JSONObject iostorinv = regionIoTab.query("iostorinv_id = '" + dtoJSONObject.getString("iostorinv_id") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.equal(iostorinv.getString("bill_status"), "3")) continue; // 已完成的单据不在继续
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("point_code1", dtoJSONObject.getString("start_point_code"));
|
||||
param.put("vehicle_code", dtoJSONObject.getString("vehicle_code"));
|
||||
// param.put("vehicle_type", vehicle_type);
|
||||
param.put("iostorinv_id", dtoJSONObject.getString("iostorinv_id"));
|
||||
CpOutTask taskBean = SpringContextHolder.getBean(CpOutTask.class);
|
||||
String task_id = taskBean.createTask(param);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
WHERE
|
||||
regionio.io_type = 输入.io_type
|
||||
AND
|
||||
start_region_id IN
|
||||
region_id IN
|
||||
(
|
||||
SELECT region.region_id FROM sch_base_region region WHERE region.region_code IN 输入.io_region
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.structivt.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.wms.st.structivt.service.StructivtService;
|
||||
import org.nl.wms.st.structivt.service.dto.StructivtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
@@ -62,5 +63,13 @@ public class StructivtController {
|
||||
structivtService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/outInventory")
|
||||
@Log("出库")
|
||||
@ApiOperation("出库")
|
||||
public ResponseEntity<Object> outInventory(@RequestBody JSONArray jsonArray){
|
||||
structivtService.outInventory(jsonArray);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.st.structivt.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.wms.st.structivt.service.dto.StructivtDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
@@ -61,5 +62,11 @@ public interface StructivtService {
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Long[] ids);
|
||||
|
||||
/**
|
||||
* 出库
|
||||
* @param jsonArray
|
||||
*/
|
||||
void outInventory(JSONArray jsonArray);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.st.structivt.service.impl;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.RegionService;
|
||||
@@ -42,7 +43,7 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(Map whereJson, Pageable page){
|
||||
JSONObject map = new JSONObject();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("region_code", "(" + whereJson.get("region_code") + ")");
|
||||
if (!ObjectUtil.isNull(whereJson.get("point_code"))) {
|
||||
@@ -227,4 +228,57 @@ public class StructivtServiceImpl implements StructivtService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库
|
||||
*
|
||||
* @param jsonArray
|
||||
*/
|
||||
@Override
|
||||
public void outInventory(JSONArray jsonArray) {
|
||||
WQLObject structIvtTab = WQLObject.getWQLObject("ST_IVT_STRUCTIVT");
|
||||
WQLObject regionIoTab = WQLObject.getWQLObject("ST_IVT_REGIONIO");
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task");
|
||||
String in_store_code = CodeUtil.getNewCode("IN_STORE_CODE");
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject structivts = jsonArray.getJSONObject(i);
|
||||
// 如果是空位或者锁定就跳过
|
||||
if (structivts.getString("lock_type").equals("2") || !structivts.getString("point_status").equals("3")) continue;
|
||||
// 找到任務
|
||||
JSONObject taskObj = taskTab.query("task_id = '" + structivts.getString("task_id") + "'").uniqueResult(0);
|
||||
String end_point_code = taskObj.getString("point_code3");
|
||||
if (ObjectUtil.isEmpty(end_point_code)) end_point_code = taskObj.getString("point_code2");
|
||||
|
||||
// 插入regionIO - 未锁定,有料位
|
||||
JSONObject regionIoObj = new JSONObject();
|
||||
regionIoObj.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
regionIoObj.put("bill_code", in_store_code); // 批量新增相同
|
||||
regionIoObj.put("buss_date", DateUtil.today());
|
||||
regionIoObj.put("io_type", "2");
|
||||
regionIoObj.put("material_id", structivts.getString("material_id"));
|
||||
regionIoObj.put("pcsn", structivts.getString("pcsn"));
|
||||
regionIoObj.put("vehicle_code", structivts.getString("vehicle_code"));
|
||||
regionIoObj.put("qty", structivts.getString("ivt_qty"));
|
||||
regionIoObj.put("qty_unit_id", structivts.getString("qty_unit_id"));
|
||||
regionIoObj.put("bill_status", "1");
|
||||
regionIoObj.put("start_point_code", structivts.getString("point_code")); // 起点
|
||||
String start_region_id = pointTab.query("point_code = '" + structivts.getString("point_code") + "'").uniqueResult(0).getString("region_id");
|
||||
if (ObjectUtil.isNotEmpty(start_region_id))
|
||||
// regionIoObj.put("start_region_id", start_region_id);
|
||||
regionIoObj.put("task_id", structivts.getString("task_id"));
|
||||
regionIoObj.put("region_id", structivts.getString("region_id"));
|
||||
regionIoObj.put("region_code", structivts.getString("region_code"));
|
||||
regionIoObj.put("region_name", structivts.getString("region_name"));
|
||||
regionIoObj.put("create_mode", "2");
|
||||
regionIoObj.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
regionIoObj.put("create_name", SecurityUtils.getCurrentNickName());
|
||||
regionIoObj.put("create_time", DateUtil.now());
|
||||
regionIoTab.insert(regionIoObj);
|
||||
// 上锁
|
||||
JSONObject point = pointTab.query("point_id = '" + structivts.getString("point_id") + "'").uniqueResult(0);
|
||||
point.put("lock_type", "2");
|
||||
pointTab.update(point);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
输入.bill_code TYPEAS s_string
|
||||
输入.bill_status TYPEAS s_string
|
||||
输入.io_type TYPEAS s_string
|
||||
输入.lock_type TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -70,7 +71,7 @@
|
||||
vehicle_type = 输入.vehicle_type
|
||||
ENDOPTION
|
||||
OPTION 输入.layer_num <> ""
|
||||
layer_num = 输入.layer_num
|
||||
cppoint.layer_num = 输入.layer_num
|
||||
ENDOPTION
|
||||
OPTION 输入.row_num <> ""
|
||||
row_num = 输入.row_num
|
||||
@@ -79,7 +80,7 @@
|
||||
col_num = 输入.col_num
|
||||
ENDOPTION
|
||||
OPTION 输入.lock_type <> ""
|
||||
YsaPoint.lock_type = 输入.lock_type
|
||||
lock_type = 输入.lock_type
|
||||
ENDOPTION
|
||||
OPTION 输入.is_used <> ""
|
||||
is_used = 输入.is_used
|
||||
|
||||
@@ -95,29 +95,27 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="bill_code" label="单据编号" min-width="150"/>
|
||||
<el-table-column prop="io_type" label="出入类型" >
|
||||
<el-table-column prop="bill_code" label="单据编号" min-width="150" />
|
||||
<el-table-column prop="io_type" label="出入类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.io_type[scope.row.io_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip/>
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="bill_status" label="单据状态" >
|
||||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip />
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="bill_status" label="单据状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="start_point_code" label="起始点位编码" min-width="120"/>
|
||||
<el-table-column prop="end_point_code" label="终点点位编码" min-width="120"/>
|
||||
<el-table-column prop="start_point_code" label="起点" min-width="120" />
|
||||
<el-table-column prop="end_point_code" label="终点" min-width="120" />
|
||||
<!-- <el-table-column prop="start_region_id" label="起始区域" />-->
|
||||
<!-- <el-table-column prop="end_region_id" label="终点区域" />-->
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="update_optname" label="修改人姓名" min-width="100"/>
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="140"/>
|
||||
<el-table-column prop="confirm_optname" label="确认人姓名" min-width="100"/>
|
||||
<el-table-column prop="confirm_time" label="确认时间" min-width="140"/>
|
||||
<el-table-column prop="update_optname" label="修改人" min-width="100" />
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="140" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -135,7 +133,7 @@
|
||||
|
||||
<script>
|
||||
import crudBill from '@/views/wms/st/regionio'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
@@ -174,7 +172,7 @@ export default {
|
||||
bill_status: [
|
||||
{ required: true, message: '单据状态不能为空', trigger: 'blur' }
|
||||
]
|
||||
} }
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
|
||||
@@ -126,7 +126,19 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission" >
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-sort"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="outInventory(crud.selections)"
|
||||
>
|
||||
出库
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="550px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="120px">
|
||||
@@ -193,9 +205,8 @@
|
||||
<el-table-column prop="point_code" label="点位编码" min-width="100" show-overflow-tooltip/>
|
||||
<el-table-column prop="region_name" label="区域名称" min-width="120" show-overflow-tooltip/>
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="ivt_qty" label="库存数" />
|
||||
<el-table-column prop="ivt_qty" label="库存数" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="instorage_time" label="入库时间" min-width="150" show-overflow-tooltip/>
|
||||
<el-table-column prop="ext_code" label="外部编码" />
|
||||
<el-table-column prop="point_status_name" label="点位状态" />
|
||||
<el-table-column prop="vehicle_type" label="托盘类型" min-width="100"/>
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
@@ -228,6 +239,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudStructivt from '../structivt'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -279,6 +291,13 @@ export default {
|
||||
},
|
||||
hand(value) {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
outInventory(values) {
|
||||
console.log(values)
|
||||
crudStructivt.outInventory(values).then(res => {
|
||||
this.crud.notify('出库成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,19 @@
|
||||
</el-form>
|
||||
</div>
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<crudOperation :permission="permission" >
|
||||
<el-button
|
||||
slot="right"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
:disabled="crud.selections.length === 0"
|
||||
@click="makeTask(crud.selections)"
|
||||
>
|
||||
生成任务
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||
@@ -95,29 +107,27 @@
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="bill_code" label="单据编号" min-width="150"/>
|
||||
<el-table-column prop="io_type" label="出入类型" >
|
||||
<el-table-column prop="bill_code" label="单据编号" min-width="150" />
|
||||
<el-table-column prop="io_type" label="出入类型">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.io_type[scope.row.io_type] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="pcsn" label="批次" />
|
||||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip/>
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="bill_status" label="单据状态" >
|
||||
<el-table-column prop="vehicle_code" label="载具编码" show-overflow-tooltip />
|
||||
<el-table-column prop="qty" label="数量" :formatter="crud.formatNum3" />
|
||||
<el-table-column prop="bill_status" label="单据状态">
|
||||
<template slot-scope="scope">
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="start_point_code" label="起始点位编码" min-width="120"/>
|
||||
<el-table-column prop="end_point_code" label="终点点位编码" min-width="120"/>
|
||||
<el-table-column prop="start_point_code" label="起点" min-width="120" />
|
||||
<el-table-column prop="end_point_code" label="终点" min-width="120" />
|
||||
<!-- <el-table-column prop="start_region_id" label="起始区域" />-->
|
||||
<!-- <el-table-column prop="end_region_id" label="终点区域" />-->
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="update_optname" label="修改人姓名" min-width="100"/>
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="140"/>
|
||||
<el-table-column prop="confirm_optname" label="确认人姓名" min-width="100"/>
|
||||
<el-table-column prop="confirm_time" label="确认时间" min-width="140"/>
|
||||
<el-table-column prop="update_optname" label="修改人" min-width="100" />
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="140" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
@@ -135,7 +145,7 @@
|
||||
|
||||
<script>
|
||||
import crudBill from '@/views/wms/st/regionio'
|
||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
@@ -153,6 +163,10 @@ export default {
|
||||
url: 'api/regionio',
|
||||
idField: 'qty_unit_id',
|
||||
sort: 'qty_unit_id,desc',
|
||||
query: {
|
||||
io_type: '2',
|
||||
io_region: "'CPQYA01'"
|
||||
},
|
||||
crudMethod: { ...crudBill }
|
||||
})
|
||||
},
|
||||
@@ -170,14 +184,18 @@ export default {
|
||||
bill_status: [
|
||||
{ required: true, message: '单据状态不能为空', trigger: 'blur' }
|
||||
]
|
||||
} }
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.query.io_type = '2'
|
||||
this.query.io_region = "'CPQYA01'"
|
||||
return true
|
||||
},
|
||||
makeTask(values) {
|
||||
crudBill.makeTask(values).then(res => {
|
||||
this.crud.notify('生成任务成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function makeTask(data) {
|
||||
return request({
|
||||
url: 'api/regionio/makeTask',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, makeTask }
|
||||
|
||||
@@ -24,4 +24,12 @@ export function edit(data) {
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
export function outInventory(data) {
|
||||
return request({
|
||||
url: 'api/structivt/outInventory',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, outInventory }
|
||||
|
||||
@@ -109,15 +109,13 @@
|
||||
{{ dict.label.st_bill_status[scope.row.bill_status] }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="start_point_code" label="起始点位编码" min-width="120" />
|
||||
<el-table-column prop="end_point_code" label="终点点位编码" min-width="120" />
|
||||
<el-table-column prop="start_point_code" label="起点" min-width="120" />
|
||||
<el-table-column prop="end_point_code" label="终点" min-width="120" />
|
||||
<!-- <el-table-column prop="start_region_id" label="起始区域" />-->
|
||||
<!-- <el-table-column prop="end_region_id" label="终点区域" />-->
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="update_optname" label="修改人姓名" min-width="100" />
|
||||
<el-table-column prop="update_optname" label="修改人" min-width="100" />
|
||||
<el-table-column prop="update_time" label="修改时间" min-width="140" />
|
||||
<el-table-column prop="confirm_optname" label="确认人姓名" min-width="100" />
|
||||
<el-table-column prop="confirm_time" label="确认时间" min-width="140" />
|
||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
|
||||
Reference in New Issue
Block a user