This commit is contained in:
USER-20220102CG\noblelift
2022-11-28 13:52:23 +08:00
25 changed files with 315 additions and 283 deletions

View File

@@ -16,26 +16,19 @@
package org.nl.modules.quartz.task; package org.nl.modules.quartz.task;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* 测试用 * 日志清理
* @author Zheng Jie * @author Zheng Jie
* @date 2019-01-08 * @date 2019-01-08
*/ */
@Slf4j @Slf4j
@Component @Component
public class TestTask { public class AutoCleanLog {
public void run(){ public void run(){
log.info("run 执行成功"); WQLObject.getWQLObject("sys_log").delete("1=1");
}
public void run1(String str){
log.info("run1 执行成功,参数为: {}" + str);
}
public void run2(){
log.info("run2 执行成功");
} }
} }

View File

@@ -1,27 +0,0 @@
package org.nl.modules.quartz.task;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.utils.SpringContextHolder;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.stereotype.Component;
@Slf4j
@Component
public class AutoDelLogTask {
public void run () {
WQLObject logTab = WQLObject.getWQLObject("sys_log");
String delete_time= SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("LOG_DELETE_TIME").getValue();
JSONArray jsonArray = WQL.getWO("SYS_LOGS01").addParam("flag", "1").process().getResultJSONArray(0);
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject json = jsonArray.getJSONObject(i);
if (Long.parseLong(delete_time) < json.getLong("time")) {
logTab.delete(json);
}
}
}
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.nl.modules.quartz.task;
import lombok.extern.slf4j.Slf4j;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.stereotype.Component;
/**
* 自动释放点位锁
*
* @author Zheng Jie
* @date 2019-01-08
*/
@Slf4j
@Component
public class AutoUnLockPoint {
public void run() {
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
JSONArray arr = WQL.getWO("QTASK_01").addParam("flag", "1").process().getResultJSONArray(0);
for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i);
json.put("lock_type", "00");
pointTab.update(json);
}
}
}

View File

@@ -0,0 +1,58 @@
[交易说明]
交易名: 解锁无任务的点位
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
输入.point_uuid TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
QUERY
SELECT point_code,point_uuid from sch_base_point WHERE lock_type='01' and point_code not in (
SELECT start_point_code as point_code from sch_base_task task WHERE is_delete='0' and task_status <>'06'
union
SELECT next_point_code as point_code from sch_base_task task WHERE is_delete='0' and task_status <>'06'
)
and point_uuid not in (
SELECT turnin_struct_uuid as point_uuid from st_buss_dumpinv dump WHERE is_delete='0' and bill_status <>'04'
union
SELECT turnout_struct_uuid as point_uuid from st_buss_dumpinv dump WHERE is_delete='0' and bill_status <>'04'
)
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -1,57 +0,0 @@
[交易说明]
交易名: 日志
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为db.properties中列出的第一个库
[IO定义]
#################################################
## 表字段对应输入参数
#################################################
输入.flag TYPEAS s_string
[临时表]
--这边列出来的临时表就会在运行期动态创建
[临时变量]
--所有中间过程变量均可在此处定义
[业务过程]
##########################################
# 1、输入输出检查 #
##########################################
##########################################
# 2、主过程前处理 #
##########################################
##########################################
# 3、业务主过程 #
##########################################
IF 输入.flag = "1"
QUERY
SELECT
TIMESTAMPDIFF(DAY,create_time,now()) AS time,request_ip,log_id
FROM
sys_log
WHERE
1=1
ORDER BY
create_time
LIMIT 100
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -26,15 +26,19 @@ import org.nl.modules.quartz.domain.QuartzJob;
import org.nl.modules.quartz.domain.QuartzLog; import org.nl.modules.quartz.domain.QuartzLog;
import org.nl.modules.quartz.repository.QuartzLogRepository; import org.nl.modules.quartz.repository.QuartzLogRepository;
import org.nl.modules.quartz.service.QuartzJobService; import org.nl.modules.quartz.service.QuartzJobService;
import org.nl.service.EmailService;
import org.nl.utils.RedisUtils; import org.nl.utils.RedisUtils;
import org.nl.utils.SpringContextHolder; import org.nl.utils.SpringContextHolder;
import org.nl.utils.ThrowableUtil; import org.nl.utils.ThrowableUtil;
import org.quartz.JobExecutionContext; import org.quartz.JobExecutionContext;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.quartz.QuartzJobBean; import org.springframework.scheduling.quartz.QuartzJobBean;
import java.util.*;
import java.util.concurrent.*; import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Future;
import java.util.concurrent.ThreadPoolExecutor;
/** /**
* 参考人人开源https://gitee.com/renrenio/renren-security * 参考人人开源https://gitee.com/renrenio/renren-security
@@ -106,12 +110,12 @@ public class ExecutionJob extends QuartzJobBean {
//更新状态 //更新状态
quartzJobService.updateIsPause(quartzJob); quartzJobService.updateIsPause(quartzJob);
} }
if(quartzJob.getEmail() != null){ /*if(quartzJob.getEmail() != null){
EmailService emailService = SpringContextHolder.getBean(EmailService.class); EmailService emailService = SpringContextHolder.getBean(EmailService.class);
// 邮箱报警 // 邮箱报警
EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e)); EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e));
emailService.send(emailVo, emailService.find()); emailService.send(emailVo, emailService.find());
} }*/
quartzLogRepository.save(log); quartzLogRepository.save(log);
} finally { } finally {

View File

@@ -8,7 +8,6 @@ import net.sf.json.JSONObject;
import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.TaskService; import org.nl.wms.sch.service.TaskService;
import org.nl.wms.sch.service.dto.TaskDto;
import org.nl.wql.core.bean.WQLObject; import org.nl.wql.core.bean.WQLObject;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -33,7 +32,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
* task_code任务编码 * task_code任务编码
* task_status1:执行中,2:完成 ,3:acs取消 * task_status1:执行中,2:完成 ,3:acs取消
* *
* @param jsonObject 条件
* @return * @return
*/ */
public static void main(String[] args) { public static void main(String[] args) {
@@ -48,7 +46,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONArray errArr = new JSONArray(); JSONArray errArr = new JSONArray();
for (int i = 0; i < array.size(); i++) { for (int i = 0; i < array.size(); i++) {
JSONObject row = array.getJSONObject(i); JSONObject row = array.getJSONObject(i);
String task_uuid = row.optString("task_uuid"); String task_uuid = row.optString("ext_task_uuid");
WQLObject wo = WQLObject.getWQLObject("sch_base_task"); WQLObject wo = WQLObject.getWQLObject("sch_base_task");
JSONObject taskObj = wo.query("task_uuid ='" + task_uuid + "'").uniqueResult(0); JSONObject taskObj = wo.query("task_uuid ='" + task_uuid + "'").uniqueResult(0);

View File

@@ -13,7 +13,6 @@ import net.sf.json.JSONObject;
import org.nl.exception.BadRequestException; import org.nl.exception.BadRequestException;
import org.nl.modules.system.util.CodeUtil; import org.nl.modules.system.util.CodeUtil;
import org.nl.utils.SecurityUtils; import org.nl.utils.SecurityUtils;
import org.nl.utils.SpringContextHolder;
import org.nl.wms.pc.service.PCOutStoreService; import org.nl.wms.pc.service.PCOutStoreService;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.PointService; import org.nl.wms.sch.service.PointService;
@@ -22,8 +21,6 @@ import org.nl.wms.sch.tasks.OutTask;
import org.nl.wms.sch.tasks.TaskTypeEnum; import org.nl.wms.sch.tasks.TaskTypeEnum;
import org.nl.wms.st.core.IOStoreMst; import org.nl.wms.st.core.IOStoreMst;
import org.nl.wms.st.core.service.IOStoreService; import org.nl.wms.st.core.service.IOStoreService;
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
import org.nl.wms.st.ivt.StoreIvtServiceImpl;
import org.nl.wms.st.util.StructFindUtil; import org.nl.wms.st.util.StructFindUtil;
import org.nl.wql.core.bean.WQLObject; import org.nl.wql.core.bean.WQLObject;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@@ -103,7 +100,7 @@ public class PCOutStoreServiceImpl implements PCOutStoreService {
//更新分配表 //更新分配表
disTable.update(disjo, "bill_uuid = '" + bill_uuid + "'"); disTable.update(disjo, "bill_uuid = '" + bill_uuid + "'");
//减少库存可用数量 //减少库存可用数量
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl(); /*StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("material_uuid", disjo.optString("material_uuid")); param.put("material_uuid", disjo.optString("material_uuid"));
param.put("bill_uuid", disjo.optString("bill_uuid")); param.put("bill_uuid", disjo.optString("bill_uuid"));
@@ -117,7 +114,7 @@ public class PCOutStoreServiceImpl implements PCOutStoreService {
param.put("label_uuid",disjo.optString("label_uuid")); param.put("label_uuid",disjo.optString("label_uuid"));
param.put("labeldtl_uuid",disjo.optString("labeldtl_uuid")); param.put("labeldtl_uuid",disjo.optString("labeldtl_uuid"));
param.put("label_code",disjo.optString("label_code")); param.put("label_code",disjo.optString("label_code"));
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE); ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);*/
//下发任务 //下发任务
JSONObject taskObj = new JSONObject(); JSONObject taskObj = new JSONObject();
String task_status = TaskStatusEnum.START_AND_POINT.getCode(); String task_status = TaskStatusEnum.START_AND_POINT.getCode();

View File

@@ -24,8 +24,6 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.PointService; import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.service.dto.PointDto; import org.nl.wms.sch.service.dto.PointDto;
import org.nl.wms.sch.tasks.QualityTestTask; import org.nl.wms.sch.tasks.QualityTestTask;
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
import org.nl.wms.st.ivt.StoreIvtServiceImpl;
import org.nl.wql.WQL; import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject; import org.nl.wql.core.bean.WQLObject;
import org.nl.wql.util.WqlUtil; import org.nl.wql.util.WqlUtil;
@@ -161,11 +159,6 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
if (ObjectUtil.isEmpty(ivtObj)) if (ObjectUtil.isEmpty(ivtObj))
throw new BadRequestException("未在熟化区找到配方为【" + formula + "】,批次为【" + pcsn + "】的库存信息"); throw new BadRequestException("未在熟化区找到配方为【" + formula + "】,批次为【" + pcsn + "】的库存信息");
JSONObject jsonPoint = WQLObject.getWQLObject("sch_base_point").query("point_uuid='" + ivtObj.optString("struct_uuid") + "' and point_status ='02' and lock_type='00'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonPoint)) {
throw new BadRequestException("该点位无法操作,请检查点位状态");
}
//仓库质检单表【st_qt_qualityTestOrder】 //仓库质检单表【st_qt_qualityTestOrder】
WQLObject qtoTab = WQLObject.getWQLObject("st_qt_qualityTestOrder"); WQLObject qtoTab = WQLObject.getWQLObject("st_qt_qualityTestOrder");
JSONObject qtoObj = new JSONObject(); JSONObject qtoObj = new JSONObject();
@@ -186,9 +179,10 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
//创建质检单后锁住货位 //创建质检单后锁住货位
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
jsonPoint.put("lock_type", "01"); param.put("point_uuid", ivtObj.optString("struct_uuid"));
jsonPoint.put("remark", "创建质检单锁住点位"); param.put("lock_type", "01");
pointTab.update(jsonPoint); param.put("remark", "创建质检单锁住点位");
pointTab.update(param);
} }
@@ -265,7 +259,8 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
//仓库质检单表【st_qt_qualityTestOrder】 //仓库质检单表【st_qt_qualityTestOrder】
WQLObject qtoTab = WQLObject.getWQLObject("st_qt_qualityTestOrder"); WQLObject qtoTab = WQLObject.getWQLObject("st_qt_qualityTestOrder");
final JSONObject qtoObj = qtoTab.query("bill_uuid = '" + bill_uuid + "'").uniqueResult(0); final JSONObject qtoObj = qtoTab.query("bill_uuid = '" + bill_uuid + "'").uniqueResult(0);
if (StrUtil.equals(QTBillStatusEnum.FINISHED.getCode(), qtoObj.optString("bill_status")))
if (StrUtil.equals(QTBillStatusEnum.FINISHED.getCode(), qtoObj.optString("bill_status")) || StrUtil.equals(QTBillStatusEnum.COERCIVE_MEASURE_FINISHED.getCode(), qtoObj.optString("bill_status")))
throw new BadRequestException("已经是完成状态!"); throw new BadRequestException("已经是完成状态!");
qtoObj.put("bill_status", "06"); qtoObj.put("bill_status", "06");
@@ -284,11 +279,14 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
//更新质检次数 //更新质检次数
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt"); WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt");
int qc_num = ivtTab.query("struct_uuid = '" + qtoObj.optString("struct_uuid") + "'").uniqueResult(0).optInt("qc_num"); JSONObject ivtObj = ivtTab.query("struct_uuid = '" + qtoObj.optString("struct_uuid") + "'").uniqueResult(0);
qc_num++; if (ObjectUtil.isNotEmpty(ivtObj)) {
JSONObject ivtParam = new JSONObject(); int qc_num = ivtTab.query("struct_uuid = '" + qtoObj.optString("struct_uuid") + "'").uniqueResult(0).optInt("qc_num");
ivtParam.put("qc_num", qc_num); qc_num++;
ivtTab.update(ivtParam, "label_uuid = '" + qtoObj.optString("label_uuid") + "'"); JSONObject ivtParam = new JSONObject();
ivtParam.put("qc_num", qc_num);
ivtTab.update(ivtParam, "struct_uuid = '" + qtoObj.optString("struct_uuid") + "'");
}
//任务基础表【sch_base_task】 //任务基础表【sch_base_task】
@@ -301,7 +299,7 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
taskTab.update(outTask); taskTab.update(outTask);
} }
JSONObject inTask = taskTab.query("task_uuid = '" + qtoObj.optString("intask_uuid") + "'").uniqueResult(0); JSONObject inTask = taskTab.query("task_uuid = '" + qtoObj.optString("intask_uuid") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(outTask)) { if (ObjectUtil.isNotEmpty(inTask)) {
inTask.put("update_time", DateUtil.now()); inTask.put("update_time", DateUtil.now());
inTask.put("update_by", SecurityUtils.getCurrentUsername()); inTask.put("update_by", SecurityUtils.getCurrentUsername());
inTask.put("task_status", TaskStatusEnum.FINISHED.getCode()); inTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
@@ -379,13 +377,17 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void outStock(String bill_uuid) { public void outStock(String bill_uuid) {
JSONObject jsonQc = WQLObject.getWQLObject("st_qt_qualitytestorder").query("bill_uuid = '" + bill_uuid + "' and is_delete = '0' and is_active = '1'").uniqueResult(0); JSONObject jsonQc = WQLObject.getWQLObject("st_qt_qualitytestorder").query("bill_uuid = '" + bill_uuid + "' and is_delete = '0'").uniqueResult(0);
JSONObject jsonIvt = WQLObject.getWQLObject("st_ivt_structivt").query("struct_uuid = '" + jsonQc.optString("struct_uuid") + "'").uniqueResult(0);
if (StrUtil.equals(QTBillStatusEnum.COERCIVE_MEASURE_FINISHED.getCode(),jsonQc.getString("bill_status"))) throw new BadRequestException("已经是出库状态");
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
JSONObject jsonIvt = ivtTab.query("struct_uuid = '" + jsonQc.optString("struct_uuid") + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonIvt)) { if (ObjectUtil.isEmpty(jsonIvt)) {
throw new BadRequestException("当前没有可出库的物料"); throw new BadRequestException("当前没有可出库的物料");
} }
//减去库存 //减去库存
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl(); /*StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("material_uuid", jsonQc.optString("material_uuid")); param.put("material_uuid", jsonQc.optString("material_uuid"));
param.put("bill_uuid", jsonQc.optString("bill_uuid")); param.put("bill_uuid", jsonQc.optString("bill_uuid"));
@@ -396,7 +398,10 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
param.put("struct_uuid", jsonIvt.optString("struct_uuid")); param.put("struct_uuid", jsonIvt.optString("struct_uuid"));
param.put("vehicle_code", jsonIvt.optString("vehicle_code")); param.put("vehicle_code", jsonIvt.optString("vehicle_code"));
param.put("label_uuid", jsonIvt.optString("label_uuid")); param.put("label_uuid", jsonIvt.optString("label_uuid"));
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE); ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE);*/
ivtTab.delete("struct_uuid = '" + jsonQc.optString("struct_uuid") + "'");
//修改点位状态 //修改点位状态
PointService pointService = SpringContextHolder.getBean(PointService.class); PointService pointService = SpringContextHolder.getBean(PointService.class);
PointDto dto = pointService.findById(jsonIvt.optString("struct_uuid")); PointDto dto = pointService.findById(jsonIvt.optString("struct_uuid"));
@@ -404,11 +409,14 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
dto.setPoint_status("00"); dto.setPoint_status("00");
dto.setVehicle_code(""); dto.setVehicle_code("");
JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task").query("task_uuid = '" + jsonQc.optString("outtask_uuid") + "'").uniqueResult(0); JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task").query("task_uuid = '" + jsonQc.optString("outtask_uuid") + "'").uniqueResult(0);
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); if (ObjectUtil.isNotEmpty(jsonTask)) {
JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.optString("next_point_code") + "'").uniqueResult(0); WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
jsonPoint.put("lock_type", "00"); JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.optString("next_point_code") + "'").uniqueResult(0);
pointTab.update(JSONObject.fromObject(dto)); jsonPoint.put("lock_type", "00");
pointTab.update(jsonPoint); pointTab.update(JSONObject.fromObject(dto));
pointTab.update(jsonPoint);
}
//更新质检单 //更新质检单
jsonQc.put("bill_status", QTBillStatusEnum.COERCIVE_MEASURE_FINISHED.getCode()); jsonQc.put("bill_status", QTBillStatusEnum.COERCIVE_MEASURE_FINISHED.getCode());
WQLObject.getWQLObject("st_qt_qualitytestorder").update(jsonQc); WQLObject.getWQLObject("st_qt_qualitytestorder").update(jsonQc);

View File

@@ -108,7 +108,8 @@
LEFT JOIN sch_base_point AS point ON ivt.struct_uuid = point.point_uuid LEFT JOIN sch_base_point AS point ON ivt.struct_uuid = point.point_uuid
WHERE WHERE
point.area_type IN ( '02', '01' ) point.area_type IN ( '02', '01' )
and point_status='02'
and lock_type='00'
OPTION 输入.label_uuid <> "" OPTION 输入.label_uuid <> ""
ivt.label_uuid = 输入.label_uuid ivt.label_uuid = 输入.label_uuid
ENDOPTION ENDOPTION

View File

@@ -5,11 +5,8 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.nl.exception.BadRequestException;
import org.nl.modules.system.service.impl.ParamServiceImpl; import org.nl.modules.system.service.impl.ParamServiceImpl;
import org.nl.utils.SpringContextHolder; import org.nl.utils.SpringContextHolder;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
/** /**
@@ -31,6 +28,7 @@ public class AcsUtil {
JSONObject object = list.getJSONObject(i); JSONObject object = list.getJSONObject(i);
String value = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode(object.getString("task_type")).getValue(); String value = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode(object.getString("task_type")).getValue();
object.put("priority", value); object.put("priority", value);
object.put("ext_task_uuid", object.getString("task_uuid"));
} }
//ACS地址127.0.0.1:8010 //ACS地址127.0.0.1:8010
String acsUrl = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("ACS_URL").getValue(); String acsUrl = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("ACS_URL").getValue();

View File

@@ -141,6 +141,7 @@ public class TaskServiceImpl implements TaskService {
} }
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void operation(Map<String, Object> map) { public void operation(Map<String, Object> map) {
String task_uuid = MapUtil.getStr(map, "task_uuid"); String task_uuid = MapUtil.getStr(map, "task_uuid");

View File

@@ -1,42 +0,0 @@
package org.nl.wms.sch.tasks;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.wql.core.bean.WQLObject;
import org.springframework.stereotype.Component;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* @author geng by
* 自动清理大于十五天的日志
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class AutoCleanUpLogs {
private ExecutorService threadPool = Executors.newCachedThreadPool();
public void run() throws Exception {
try {
System.out.println("开始清理日志");
// 0 0/10 0,1 * * ? * 每天0-1点执行间隔10分钟一次
//sys_log
//delete from sys_log where DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 day)) limit 10;
WQLObject logTab = WQLObject.getWQLObject("sys_log");
String days = WQLObject.getWQLObject("sys_param").query("code='clean_day'").uniqueResult(0).getString("value");
logTab.delete("DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL '" + days + "' day))");
log.info("自动清理日志执行成功...!");
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -41,10 +41,14 @@ public class DumpInvTask extends AbstractAcsTask {
//更新转储单状态相关信息 //更新转储单状态相关信息
JSONObject dumpObj = dumpInvTab.query("task_uuid = '" + taskObj.optString("task_uuid") + "'").uniqueResult(0); JSONObject dumpObj = dumpInvTab.query("task_uuid = '" + taskObj.optString("task_uuid") + "'").uniqueResult(0);
dumpObj.put("update_time", DateUtil.now()); if (ObjectUtil.isNotEmpty(dumpObj)) {
dumpObj.put("bill_status", DumpInvBillStatusEnum.TASK_EXECUTING.getCode()); dumpObj.put("update_time", DateUtil.now());
dumpObj.put("update_by", SecurityUtils.getCurrentUsername()); dumpObj.put("bill_status", DumpInvBillStatusEnum.TASK_EXECUTING.getCode());
dumpInvTab.update(dumpObj); dumpObj.put("update_by", SecurityUtils.getCurrentUsername());
dumpInvTab.update(dumpObj);
}
} }
//完成 //完成
if (TaskStatusEnum.FINISHED.getCode().equals(status)) { if (TaskStatusEnum.FINISHED.getCode().equals(status)) {
@@ -56,7 +60,7 @@ public class DumpInvTask extends AbstractAcsTask {
//更新转储单状态相关信息 //更新转储单状态相关信息
JSONObject dumpObj = dumpInvTab.query("task_uuid = '" + taskObj.optString("task_uuid") + "'").uniqueResult(0); JSONObject dumpObj = dumpInvTab.query("task_uuid = '" + taskObj.optString("task_uuid") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(dumpObj)){ if (ObjectUtil.isNotEmpty(dumpObj)) {
dumpObj.put("update_time", DateUtil.now()); dumpObj.put("update_time", DateUtil.now());
dumpObj.put("bill_status", DumpInvBillStatusEnum.FINISHED.getCode()); dumpObj.put("bill_status", DumpInvBillStatusEnum.FINISHED.getCode());
dumpObj.put("update_by", SecurityUtils.getCurrentUsername()); dumpObj.put("update_by", SecurityUtils.getCurrentUsername());
@@ -67,25 +71,29 @@ public class DumpInvTask extends AbstractAcsTask {
// 点位基础表【sch_base_point】 // 点位基础表【sch_base_point】
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
JSONObject startPoint = pointTab.query("point_code='" + taskObj.optString("start_point_code") + "'").uniqueResult(0); JSONObject startPoint = pointTab.query("point_code='" + taskObj.optString("start_point_code") + "'").uniqueResult(0);
startPoint.put("lock_type", "00"); if (ObjectUtil.isNotEmpty(startPoint)) {
startPoint.put("point_status", "00"); startPoint.put("lock_type", "00");
startPoint.put("vehicle_code", ""); startPoint.put("point_status", "00");
pointTab.update(startPoint); startPoint.put("vehicle_code", "");
pointTab.update(startPoint);
}
JSONObject nextPoint = pointTab.query("point_code='" + taskObj.optString("next_point_code") + "'").uniqueResult(0); JSONObject nextPoint = pointTab.query("point_code='" + taskObj.optString("next_point_code") + "'").uniqueResult(0);
nextPoint.put("lock_type", "00"); if (ObjectUtil.isNotEmpty(nextPoint)) {
nextPoint.put("point_status", "02"); nextPoint.put("lock_type", "00");
nextPoint.put("vehicle_code", taskObj.optString("vehicle_code")); nextPoint.put("point_status", "02");
pointTab.update(nextPoint); nextPoint.put("vehicle_code", taskObj.optString("vehicle_code"));
pointTab.update(nextPoint);
}
//更新库存,因为是转储,直接更新货位即可 //更新库存,因为是转储,直接更新货位即可
//仓位库存表【st_ivt_structIvt】 //仓位库存表【st_ivt_structIvt】
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt"); WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt");
if (ObjectUtil.isNotEmpty(dumpObj)){ if (ObjectUtil.isNotEmpty(dumpObj)) {
JSONObject turnOutIvtObj = ivtTab.query("struct_uuid = '" + dumpObj.optString("turnout_struct_uuid") + "'").uniqueResult(0); JSONObject turnOutIvtObj = ivtTab.query("struct_uuid = '" + dumpObj.optString("turnout_struct_uuid") + "'").uniqueResult(0);
if (!ObjectUtil.isEmpty(turnOutIvtObj)){ if (!ObjectUtil.isEmpty(turnOutIvtObj)) {
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl(); StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
JSONObject ivtObj = new JSONObject(); JSONObject ivtObj = new JSONObject();
ivtObj.put("struct_uuid", dumpObj.optString("turnin_struct_uuid")); ivtObj.put("struct_uuid", dumpObj.optString("turnin_struct_uuid"));
@@ -107,9 +115,7 @@ public class DumpInvTask extends AbstractAcsTask {
//转出仓位扣减库存 //转出仓位扣减库存
/*ivtService.addIvtFlow(ivtObj, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE); /*ivtService.addIvtFlow(ivtObj, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE);
ivtObj.put("struct_uuid", dumpObj.optString("turnin_struct_uuid"));*/ ivtObj.put("struct_uuid", dumpObj.optString("turnin_struct_uuid"));*/
WQLObject.getWQLObject("st_ivt_structIvt").delete("struct_uuid = '"+startPoint.getString("point_uuid")+"'"); WQLObject.getWQLObject("st_ivt_structIvt").delete("struct_uuid = '" + startPoint.getString("point_uuid") + "'");
} }
@@ -147,6 +153,17 @@ public class DumpInvTask extends AbstractAcsTask {
taskObj.put("create_by", SecurityUtils.getCurrentUsername()); taskObj.put("create_by", SecurityUtils.getCurrentUsername());
taskObj.put("update_time", DateUtil.now()); taskObj.put("update_time", DateUtil.now());
//锁住起点终点
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
JSONObject pointParam = new JSONObject();
pointParam.put("lock_type", "01");
pointParam.put("update_time", DateUtil.now());
pointParam.put("remark", "转储锁起点");
pointTab.update(pointParam, "point_code='" + param.optString("start_point_code") + "'");
pointParam.put("remark", "转储锁终点");
pointTab.update(pointParam, "point_code='" + param.optString("next_point_code") + "'");
//任务基础表【sch_base_task】 //任务基础表【sch_base_task】
WQLObject.getWQLObject("sch_base_task").insert(taskObj); WQLObject.getWQLObject("sch_base_task").insert(taskObj);
return taskObj.optString("task_uuid"); return taskObj.optString("task_uuid");
@@ -177,10 +194,9 @@ public class DumpInvTask extends AbstractAcsTask {
point_codeflag = point_codeflag.substring(point_codeflag.length() - 2); point_codeflag = point_codeflag.substring(point_codeflag.length() - 2);
JSONObject nextPoint = new JSONObject(); JSONObject nextPoint = new JSONObject();
if (StrUtil.equals("01", point_codeflag)) { if (StrUtil.equals("01", point_codeflag)) {
nextPoint = WQL.getWO("QSCH_DUMP01").addParam("flag", "4").addParam("area_type", "03").process().uniqueResult(0); nextPoint = WQL.getWO("QSCH_DUMP01").addParam("flag", "4").addParam("area_type", "03").process().uniqueResult(0);
} } else {
else { nextPoint = WQL.getWO("QSCH_DUMP01").addParam("flag", "3").addParam("area_type", "03").process().uniqueResult(0);
nextPoint = WQL.getWO("QSCH_DUMP01").addParam("flag", "3").addParam("area_type", "03").process().uniqueResult(0);
} }

View File

@@ -242,7 +242,7 @@ public class InTask extends AbstractAcsTask {
} }
JSONObject taskjo = WQLObject.getWQLObject("sch_base_task").query("task_uuid='" + task_uuid + "'").uniqueResult(0); JSONObject taskjo = WQLObject.getWQLObject("sch_base_task").query("task_uuid='" + task_uuid + "'").uniqueResult(0);
taskjo.optString("taskfinish_mode", "02"); taskjo.optString("taskfinish_mode", "02");
this.updateTaskStatus(taskjo, TaskStatusEnum.FINISHED.getCode()); this.updateTaskStatus(taskjo, TaskStatusEnum.EXECUTING.getCode());
} }
@Override @Override

View File

@@ -54,26 +54,35 @@ public class OutEmptyVehicleTask extends AbstractAcsTask {
//更新空载具表状态 //更新空载具表状态
JSONObject jsonEtv = etvTab.query("task_uuid='" + taskObj.optString("task_uuid") + "'").uniqueResult(0); JSONObject jsonEtv = etvTab.query("task_uuid='" + taskObj.optString("task_uuid") + "'").uniqueResult(0);
jsonEtv.put("update_by", SecurityUtils.getCurrentUsername()); if (ObjectUtil.isNotEmpty(jsonEtv)){
jsonEtv.put("update_time", DateUtil.now()); jsonEtv.put("update_by", SecurityUtils.getCurrentUsername());
jsonEtv.put("bill_status", EmptyVehicleBillStatusEnum.FINISHED.getCode()); jsonEtv.put("update_time", DateUtil.now());
etvTab.update(jsonEtv); jsonEtv.put("bill_status", EmptyVehicleBillStatusEnum.FINISHED.getCode());
etvTab.update(jsonEtv);
}
//解锁货位 //解锁货位
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point"); WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
//解锁起始点位 //解锁起始点位
JSONObject startPoint = pointTab.query("point_code='" + jsonEtv.optString("start_point_code") + "'").uniqueResult(0); JSONObject startPoint = pointTab.query("point_code='" + jsonEtv.optString("start_point_code") + "'").uniqueResult(0);
startPoint.put("lock_type", "00"); if (ObjectUtil.isNotEmpty(startPoint)){
startPoint.put("point_status", "00"); startPoint.put("lock_type", "00");
startPoint.put("vehicle_code", ""); startPoint.put("point_status", "00");
pointTab.update(startPoint); startPoint.put("vehicle_code", "");
pointTab.update(startPoint);
}
//解锁下一点位 //解锁下一点位
JSONObject nextPoint = pointTab.query("point_code='" + jsonEtv.optString("next_point_code") + "'").uniqueResult(0); JSONObject nextPoint = pointTab.query("point_code='" + jsonEtv.optString("next_point_code") + "'").uniqueResult(0);
nextPoint.put("lock_type", "00"); if (ObjectUtil.isNotEmpty(nextPoint)){
nextPoint.put("point_status", "01"); nextPoint.put("lock_type", "00");
nextPoint.put("vehicle_code", jsonEtv.optString("vehicle_code")); nextPoint.put("point_status", "01");
pointTab.update(nextPoint); if (ObjectUtil.isNotEmpty(jsonEtv)){
nextPoint.put("vehicle_code", jsonEtv.optString("vehicle_code"));
}
pointTab.update(nextPoint);
}
} }

View File

@@ -14,14 +14,11 @@ import org.nl.wms.sch.manage.AbstractAcsTask;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.service.PointService; import org.nl.wms.sch.service.PointService;
import org.nl.wms.sch.service.dto.PointDto; import org.nl.wms.sch.service.dto.PointDto;
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
import org.nl.wms.st.ivt.StoreIvtServiceImpl; import org.nl.wms.st.ivt.StoreIvtServiceImpl;
import org.nl.wms.st.util.StructFindUtil; import org.nl.wms.st.util.StructFindUtil;
import org.nl.wql.core.bean.WQLObject; import org.nl.wql.core.bean.WQLObject;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* 出库任务生成 * 出库任务生成
*/ */
@@ -178,7 +175,11 @@ public class OutTask extends AbstractAcsTask {
json.put("vehicle_code", structObj.optString("vehicle_code")); json.put("vehicle_code", structObj.optString("vehicle_code"));
json.put("task_uuid", task_uuid); json.put("task_uuid", task_uuid);
disTab.update(json); disTab.update(json);
//减少库存可用数量
//直接删除起点
/* //减少库存可用数量
JSONObject param = new JSONObject(); JSONObject param = new JSONObject();
param.put("material_uuid", disObj.optString("material_uuid")); param.put("material_uuid", disObj.optString("material_uuid"));
param.put("label_uuid", disObj.optString("label_uuid")); param.put("label_uuid", disObj.optString("label_uuid"));
@@ -190,7 +191,7 @@ public class OutTask extends AbstractAcsTask {
PointService pointService = SpringContextHolder.getBean(PointService.class); PointService pointService = SpringContextHolder.getBean(PointService.class);
param.put("struct_uuid", pointService.findByCode(struct_code).getPoint_uuid()); param.put("struct_uuid", pointService.findByCode(struct_code).getPoint_uuid());
param.put("vehicle_code", structObj.optString("vehicle_code")); param.put("vehicle_code", structObj.optString("vehicle_code"));
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE); ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);*/
//修改明细表中的状态 //修改明细表中的状态
JSONObject dtljson = dtlTab.query("billdtl_uuid='" + billdtl_uuid + "'").uniqueResult(0); JSONObject dtljson = dtlTab.query("billdtl_uuid='" + billdtl_uuid + "'").uniqueResult(0);
dtljson.put("bill_status", "30"); dtljson.put("bill_status", "30");

View File

@@ -2,6 +2,7 @@ package org.nl.wms.sch.tasks;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.nl.exception.BadRequestException; import org.nl.exception.BadRequestException;
@@ -75,13 +76,16 @@ public class QualityTestTask extends AbstractAcsTask {
qtoTab.update(qtObj, "intask_uuid = '" + task_uuid + "'"); qtoTab.update(qtObj, "intask_uuid = '" + task_uuid + "'");
//更新质检次数 //更新质检次数
//仓位库存表【st_ivt_structIvt】 //仓位库存表【st_ivt_structIvt】
String label_uuid = qtoTab.query("intask_uuid = '" + task_uuid + "'").uniqueResult(0).optString("label_uuid"); String struct_uuid = qtoTab.query("intask_uuid = '" + task_uuid + "'").uniqueResult(0).optString("struct_uuid");
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt"); WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt");
int qc_num = ivtTab.query("label_uuid = '" + label_uuid + "'").uniqueResult(0).optInt("qc_num"); JSONObject ivtObj= ivtTab.query("struct_uuid = '" + struct_uuid + "'").uniqueResult(0);
qc_num++; if (ObjectUtil.isNotEmpty(ivtObj)){
JSONObject ivtParam = new JSONObject(); int qc_num = ivtTab.query("struct_uuid = '" + struct_uuid + "'").uniqueResult(0).optInt("qc_num");
ivtParam.put("qc_num", qc_num); qc_num++;
ivtTab.update(ivtParam, "label_uuid = '" + label_uuid + "'"); JSONObject ivtParam = new JSONObject();
ivtParam.put("qc_num", qc_num);
ivtTab.update(ivtParam, "struct_uuid = '" + struct_uuid + "'");
}
//更新质检点位状态 //更新质检点位状态
JSONObject pointObj = new JSONObject(); JSONObject pointObj = new JSONObject();

View File

@@ -173,11 +173,12 @@ public class DumpinvServiceImpl implements DumpinvService {
//点位基础表【sch_base_point】 //点位基础表【sch_base_point】
JSONObject startPoint = pointTab.query("point_uuid = '" + json.optString("turnout_struct_uuid") + "'").uniqueResult(0); JSONObject startPoint = pointTab.query("point_uuid = '" + json.optString("turnout_struct_uuid") + "'").uniqueResult(0);
startPoint.put("lock_type", "01"); startPoint.put("lock_type", "01");
pointTab.update(startPoint); pointTab.update(startPoint,"point_uuid ='"+startPoint.getString("point_uuid")+"'");
JSONObject nextPoint = pointTab.query("point_uuid = '" + json.optString("turnin_struct_uuid") + "'").uniqueResult(0); JSONObject nextPoint = pointTab.query("point_uuid = '" + json.optString("turnin_struct_uuid") + "'").uniqueResult(0);
nextPoint.put("lock_type", "01"); nextPoint.put("lock_type", "01");
pointTab.update(nextPoint); pointTab.update(nextPoint,"point_uuid ='"+nextPoint.getString("point_uuid")+"'");
pointTab.update(nextPoint);
} }

View File

@@ -245,7 +245,7 @@ public class IOStoreServiceImpl implements IOStoreService {
//出库 //出库
if (StrUtil.equals("20", buss_type)) { if (StrUtil.equals("20", buss_type)) {
param.put("struct_uuid", pointService.findByCode(disObj.optString("start_point_code")).getPoint_uuid()); param.put("struct_uuid", pointService.findByCode(disObj.optString("start_point_code")).getPoint_uuid());
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE); /*ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);*/
} }
} }
@@ -375,7 +375,7 @@ public class IOStoreServiceImpl implements IOStoreService {
param.put("change_weight", disObj.optString("realassign_weight")); param.put("change_weight", disObj.optString("realassign_weight"));
param.put("struct_uuid", startPoint.getPoint_uuid()); param.put("struct_uuid", startPoint.getPoint_uuid());
param.put("vehicle_code", vehicle_code); param.put("vehicle_code", vehicle_code);
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE); /*ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE)*/;
} }
} }
AbstractIOStoreManager manager = new IOStoreManager(); AbstractIOStoreManager manager = new IOStoreManager();

View File

@@ -56,7 +56,7 @@ https://juejin.cn/post/6844903775631572999
<!--生产环境:打印控制台和输出到文件--> <!--生产环境:打印控制台和输出到文件-->
<springProfile name="prod"> <springProfile name="prod">
<root level="debug"> <root level="info">
<appender-ref ref="asyncFileAppender"/> <appender-ref ref="asyncFileAppender"/>
</root> </root>

Binary file not shown.

View File

@@ -1,11 +1,36 @@
<template> <template>
<div id="app"> <div id="app" @mousemove="moveEvent" @click="moveEvent">
<router-view /> <router-view />
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'App' name: 'App',
data() {
return {
timmer: null
}
},
methods: {
moveEvent: function() {
const path = ['/login']
if (!path.includes(this.$route.path)) {
clearTimeout(this.timmer)
this.init()
}
},
init: function() {
this.timmer = setTimeout(() => {
sessionStorage.clear()
this.logout()
}, 1000 * 60 * 30) // 30分钟 https://blog.csdn.net/qq_42345108/article/details/103496456
},
logout() {
this.$store.dispatch('LogOut').then(() => {
location.reload()
})
}
}
} }
</script> </script>

View File

@@ -1,20 +1,20 @@
<template> <template>
<div style="border: 1px solid #938d8d;margin-left: 10px;margin-right: 10px;"> <div style="border: 1px solid #938d8d;margin-left: 10px;margin-right: 10px;">
<el-row> <el-row>
<el-col :span="14"> <el-col :span="18">
<div class="grid-content bg-purple"><h2 style="margin-left: 30px;padding-top: 10px;">车间加工看板</h2></div> <div class="grid-content bg-purple"><h2 style="margin-left: 30px;padding-top: 10px;">车间加工看板</h2></div>
<div class="grid-content bg-purple"> <div class="grid-content bg-purple">
&ensp;&ensp; &ensp;&ensp;
<!-- <el-button type="primary" icon="el-icon-search" @click="queryTask(query.device_code)">搜索</el-button>--> <!-- <el-button type="primary" icon="el-icon-search" @click="queryTask(query.device_code)">搜索</el-button>-->
<el-button type="primary" icon="el-icon-thumb" @click="fresh">界面刷新</el-button> <el-button type="primary" icon="el-icon-thumb" @click="fresh">界面刷新</el-button>
<el-button type="warning" icon="el-icon-position" @click="callMaterial">生产叫料</el-button> <el-button style="margin-left: 30px;" type="warning" icon="el-icon-position" @click="callMaterial">生产叫料</el-button>
<el-button type="success" icon="el-icon-finished" @click="finish">生产完成</el-button> <el-button style="margin-left: 30px;" type="success" icon="el-icon-finished" @click="finish">生产完成</el-button>
<el-button type="danger" icon="el-icon-top-left" @click="materialBack">余料回库</el-button> <el-button style="margin-left: 30px;" type="danger" icon="el-icon-top-left" @click="materialBack">余料回库</el-button>
<el-button type="info" icon="el-icon-top-left" @click="emptyVehicleBack">空托回库</el-button> <el-button style="margin-left: 30px;" type="info" icon="el-icon-top-left" @click="emptyVehicleBack">空托回库</el-button>
</div> </div>
</el-col> </el-col>
<el-col :span="10"> <el-col :span="6">
<div class="grid-content bg-purple-light"> <div class="grid-content bg-purple-light">
<h2 style="text-align:right;margin-right: 140px;">{{ getTime }}</h2> <h2 style="text-align:right;margin-right: 140px;">{{ getTime }}</h2>
</div> </div>

View File

@@ -37,7 +37,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<rrOperation /> <rrOperation/>
</el-form> </el-form>
</div> </div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@@ -62,28 +62,28 @@
style="width: 100%;" style="width: 100%;"
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
> >
<el-table-column type="selection" width="55" /> <el-table-column type="selection" width="55"/>
<el-table-column prop="bill_code" label="单据编码" width="115" /> <el-table-column prop="bill_code" label="单据编码" width="115"/>
<el-table-column prop="bill_date" label="业务日期" width="85" /> <el-table-column prop="bill_date" label="业务日期" width="85"/>
<el-table-column prop="bill_status" label="单据状态" :formatter="formatBillStatusName" width="100" /> <el-table-column prop="bill_status" label="单据状态" :formatter="formatBillStatusName" width="100"/>
<el-table-column prop="struct_code" label="仓位编码" min-width="100" show-overflow-tooltip /> <el-table-column prop="struct_code" label="仓位编码" min-width="100" show-overflow-tooltip/>
<el-table-column prop="struct_name" label="仓位名称" width="120" /> <el-table-column prop="struct_name" label="仓位名称" width="120"/>
<el-table-column prop="vehicle_code" label="载具号" /> <el-table-column prop="vehicle_code" label="载具号"/>
<el-table-column prop="material_code" label="物料编码" /> <el-table-column prop="material_code" label="物料编码"/>
<el-table-column prop="material_name" label="物料名称" /> <el-table-column prop="material_name" label="物料名称"/>
<el-table-column v-if="false" prop="outtask_uuid" label="出库任务标识" /> <el-table-column v-if="false" prop="outtask_uuid" label="出库任务标识"/>
<el-table-column v-if="false" prop="intask_uuid" label="入库任务标识" /> <el-table-column v-if="false" prop="intask_uuid" label="入库任务标识"/>
<el-table-column prop="remark" label="备注" show-overflow-tooltip /> <el-table-column prop="remark" label="备注" show-overflow-tooltip/>
<el-table-column prop="update_by" label="修改者" /> <el-table-column prop="update_by" label="修改者"/>
<el-table-column prop="update_time" label="修改时间" width="135" /> <el-table-column prop="update_time" label="修改时间" width="135"/>
<el-table-column <el-table-column
v-permission="['admin','instruction:edit','instruction:del']" v-permission="['admin','instruction:edit','instruction:del']"
fixed="right" fixed="left"
label="操作" label="操作"
width="340px" width="70px"
align="center" align="center"
> >
<template slot-scope="scope" > <!--<template slot-scope="scope" >
<el-button <el-button
type="text" type="text"
icon="el-icon-delete-solid" icon="el-icon-delete-solid"
@@ -114,29 +114,29 @@
icon="el-icon-s-home" icon="el-icon-s-home"
@click="handleCommand(scope.row, 'f')" @click="handleCommand(scope.row, 'f')"
>出库</el-button> >出库</el-button>
</template>-->
<template slot-scope="scope">
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
<i class="el-icon-menu"/>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">删除</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">搬出</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">通过</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'d')">不通过</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'e')">完成</el-dropdown-item>
<el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'f')">出库</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</template> </template>
<!-- <template slot-scope="scope">-->
<!-- <el-dropdown trigger="click" @command="handleCommand">-->
<!-- <span class="el-dropdown-link">-->
<!-- <i class="el-icon-menu" />-->
<!-- </span>-->
<!-- <el-dropdown-menu slot="dropdown">-->
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'a')">删除</el-dropdown-item>-->
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'b')">搬出</el-dropdown-item>-->
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'c')">通过</el-dropdown-item>-->
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'d')">不通过</el-dropdown-item>-->
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'e')">完成</el-dropdown-item>-->
<!-- <el-dropdown-item :command="beforeHandleCommand(scope.$index, scope.row,'f')">出库</el-dropdown-item>-->
<!-- </el-dropdown-menu>-->
<!-- </el-dropdown>-->
<!-- </template>-->
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<pagination /> <pagination/>
</div> </div>
<AddDialog :dialog-show.sync="addShow" /> <AddDialog :dialog-show.sync="addShow"/>
</div> </div>
</template> </template>
@@ -233,25 +233,25 @@ export default {
'command': command 'command': command
} }
}, },
handleCommand(row, command) { handleCommand(data, command) {
switch (command) { switch (data.command) {
case 'a':// 删除 case 'a':// 删除
this.opt_delete(row) this.opt_delete(data.row)
break break
case 'b':// 搬出 case 'b':// 搬出
this.moveOut(row) this.moveOut(data.row)
break break
case 'c':// 通过 case 'c':// 通过
this.isPass(row, 1) this.isPass(data.row, 1)
break break
case 'd':// 不通过 case 'd':// 不通过
this.isPass(row, 0) this.isPass(data.row, 0)
break break
case 'e':// 确认 case 'e':// 确认
this.confirm(row) this.confirm(data.row)
break break
case 'f':// 出库 case 'f':// 出库
this.outStock(row) this.outStock(data.row)
break break
} }
}, },