opt: 1
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* 株洲中钨的驱动类存放于此
|
||||
* @Author: lyd
|
||||
* @Date: 2025/8/6
|
||||
*/
|
||||
package org.nl.acs.device_driver.zzzw;
|
||||
@@ -130,6 +130,10 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
log.info("解包叫料,请求参数:{}", whereJson);
|
||||
// workorder_id、area、point_code
|
||||
String pointCode = whereJson.getString("point_code");
|
||||
String area = whereJson.getString("area");
|
||||
if (!"DDJBQ".equals(area)) {
|
||||
throw new BadRequestException("请选择吨袋解包区!");
|
||||
}
|
||||
RLock lock = redissonClient.getLock(pointCode);
|
||||
boolean tryLock = lock.tryLock(0, TimeUnit.SECONDS);
|
||||
try {
|
||||
@@ -259,6 +263,9 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
res.put("flag", "1");
|
||||
res.put("message", "重量误差范围正常!");
|
||||
PdmBdWorkorder workorder = workorderService.getById(workorder_id);
|
||||
if (ObjectUtil.isEmpty(workorder)) {
|
||||
throw new BadRequestException("请选择工单!");
|
||||
}
|
||||
res.put("org_weight", workorder.getPlan_weight());
|
||||
res.put("stand_error", param.getValue());
|
||||
if (workorder.getPlan_weight().subtract(BigDecimal.valueOf(999.99))
|
||||
@@ -348,12 +355,12 @@ public class PdaJBServiceImpl implements PdaJBService {
|
||||
workorder.setWorkorder_status("5");
|
||||
workorder.setRealproduceend_date(DateUtil.now());
|
||||
workorderService.updateById(workorder);
|
||||
} else {
|
||||
throw new BadRequestException("速度太快啦,稍后再试...");
|
||||
}
|
||||
} finally {
|
||||
if (tryLock) {
|
||||
lock.unlock();
|
||||
} else {
|
||||
throw new BadRequestException("速度太快啦,稍后再试...");
|
||||
}
|
||||
}
|
||||
return PdaResponse.requestOk();
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
package org.nl.wms.sch_manage.service.util;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 通用定义类型数据
|
||||
* @Date: 2023/7/13
|
||||
*/
|
||||
public class GeneralDefinition {
|
||||
/**
|
||||
* 默认密码
|
||||
*/
|
||||
public static final String DEFAULT_PASSWORD = "123456";
|
||||
/**
|
||||
* 盐值加密
|
||||
*/
|
||||
public static final String SALT = "salt";
|
||||
/**
|
||||
* 转义点
|
||||
*/
|
||||
public static final String ESCAPE_DOT = "\\.";
|
||||
/**
|
||||
* 点
|
||||
*/
|
||||
public static final String DOT = ".";
|
||||
/**
|
||||
* 日期变量
|
||||
*/
|
||||
public static final String DATE_FORMAT = "yyyy-MM-dd";
|
||||
/**
|
||||
* 时间变量
|
||||
*/
|
||||
public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
public static final String UNKNOWN = "-";
|
||||
// 统一编码定义
|
||||
/**
|
||||
* 窑自动任务开启
|
||||
*/
|
||||
public static final String AUTO_KILN_CALL = "auto_kiln_call";
|
||||
// 是否
|
||||
/**
|
||||
* 是/正确/可用...
|
||||
*/
|
||||
public static final String YES = "1";
|
||||
/**
|
||||
* 否/错误/不可用...
|
||||
*/
|
||||
public static final String NO = "0";
|
||||
// 载具类型
|
||||
/**
|
||||
* 料盅
|
||||
*/
|
||||
public static final String MATERIAL_CUP = "LZ";
|
||||
/**
|
||||
* 钢托盘
|
||||
*/
|
||||
public static final String STEEL_TRAY = "GTP";
|
||||
// 账号定义
|
||||
/**
|
||||
* acs系统
|
||||
*/
|
||||
public static final String ACS_ID = "2";
|
||||
/**
|
||||
* acs系统
|
||||
*/
|
||||
public static final String ACS_NAME = "ACS系统";
|
||||
/**
|
||||
* mes系统
|
||||
*/
|
||||
public static final String MES_ID = "3";
|
||||
/**
|
||||
* mes系统
|
||||
*/
|
||||
public static final String MES_NAME = "MES系统";
|
||||
// 点位类型
|
||||
/**
|
||||
* 设备位
|
||||
*/
|
||||
public static final String DEVICE_POINT = "1";
|
||||
/**
|
||||
* 对接位
|
||||
*/
|
||||
public static final String DOCKING_POINT = "2";
|
||||
/**
|
||||
* 检测位
|
||||
*/
|
||||
public static final String CHECK_POINT = "4";
|
||||
// 出入口
|
||||
/**
|
||||
* 入口
|
||||
**/
|
||||
public static final String ENTRANCE = "1";
|
||||
/**
|
||||
* 出口
|
||||
**/
|
||||
public static final String EXIT = "2";
|
||||
// 任务生产方式
|
||||
/**
|
||||
* 自动创建
|
||||
**/
|
||||
public static final String AUTO_CREATION = "1";
|
||||
/**
|
||||
* ACS创建
|
||||
**/
|
||||
public static final String ACS_CREATION = "2";
|
||||
// 请求方向
|
||||
/**
|
||||
* ACS->LMS
|
||||
**/
|
||||
public static final String ACS_LMS = "1";
|
||||
/**
|
||||
* LMS->ACS
|
||||
**/
|
||||
public static final String LMS_ACS = "2";
|
||||
/**
|
||||
* MES->LMS
|
||||
**/
|
||||
public static final String MES_LMS = "3";
|
||||
/**
|
||||
* LMS->MES
|
||||
**/
|
||||
public static final String LMS_MES = "4";
|
||||
// 区域定义
|
||||
/**
|
||||
* 料盅睏料线区域
|
||||
*/
|
||||
public static final String LZKLX = "LZKLX";
|
||||
/**
|
||||
* 干燥窑区域
|
||||
*/
|
||||
public static final String GZY = "GZY";
|
||||
// 特殊: 1-缓存输送线入口,2-缓存输送线出口,3-上输送线,4-下输送线
|
||||
/**
|
||||
* 上输送线
|
||||
*/
|
||||
public static final String UPPER_CONVEYOR_LINE = "3";
|
||||
/**
|
||||
* 下输送线
|
||||
*/
|
||||
public static final String LOWER_CONVEYOR_LINE = "4";
|
||||
// 参数名称
|
||||
/**
|
||||
* 是否连接
|
||||
*/
|
||||
public static final String IS_CONNECT_ACS = "is_connect_acs";
|
||||
/**
|
||||
* ACS路径
|
||||
*/
|
||||
public static final String ACS_URL = "acs_url";
|
||||
/**
|
||||
* 是否连接
|
||||
*/
|
||||
public static final String IS_CONNECT_MES = "is_connect_mes";
|
||||
/**
|
||||
* MES路径
|
||||
*/
|
||||
public static final String MES_URL = "mes_url";
|
||||
// 完成/取消
|
||||
/**
|
||||
* 任务完成
|
||||
*/
|
||||
public static final String TASK_FINISH = "任务完成";
|
||||
/**
|
||||
* 任务取消
|
||||
*/
|
||||
public static final String TASK_CANCEL = "任务取消";
|
||||
/**
|
||||
* 区域 - 分拣
|
||||
*/
|
||||
public static final String AREA_FJ = "FJ";
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package org.nl.wms.sch_manage.service.util;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.wms.sch_manage.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
|
||||
/**
|
||||
* @Author: lyd
|
||||
* @Description: 任务修改抽取的公用方法
|
||||
* @Date: 2023/6/13
|
||||
*/
|
||||
@Slf4j
|
||||
public class TaskUtils {
|
||||
public static void setCreateByAcs(SchBaseTask taskObj) {
|
||||
taskObj.setCreate_id(GeneralDefinition.ACS_ID);
|
||||
taskObj.setCreate_name(GeneralDefinition.ACS_NAME);
|
||||
taskObj.setCreate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
public static void setCreateByPda(SchBaseTask taskObj) {
|
||||
taskObj.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
taskObj.setCreate_name(SecurityUtils.getCurrentNickName());
|
||||
taskObj.setCreate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
public static void setUpdateByAcs(SchBaseTask taskObj) {
|
||||
taskObj.setUpdate_id(GeneralDefinition.ACS_ID);
|
||||
taskObj.setUpdate_name(GeneralDefinition.ACS_NAME);
|
||||
taskObj.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
public static void setUpdateByPC(SchBaseTask taskObj) {
|
||||
taskObj.setUpdate_id(SecurityUtils.getCurrentUserId());
|
||||
taskObj.setUpdate_name(SecurityUtils.getCurrentNickName());
|
||||
taskObj.setUpdate_time(DateUtil.now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据类型去判断谁修改的
|
||||
* @param taskObj
|
||||
* @param taskFinishedType
|
||||
*/
|
||||
public static void setUpdateByType(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
if (taskFinishedType.equals(TaskFinishedTypeEnum.AUTO_ACS)) {
|
||||
setUpdateByAcs(taskObj);
|
||||
} else {
|
||||
setUpdateByPC(taskObj);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import org.nl.wms.basedata_manage.service.IStructattrService;
|
||||
import org.nl.wms.basedata_manage.service.dao.Structattr;
|
||||
import org.nl.wms.pm_manage.service.IPdmBdWorkorderService;
|
||||
import org.nl.wms.pm_manage.service.dao.PdmBdWorkorder;
|
||||
import org.nl.wms.sch_manage.enums.TaskFinishedTypeEnum;
|
||||
import org.nl.wms.sch_manage.enums.TaskStatus;
|
||||
import org.nl.wms.sch_manage.service.ISchBasePointService;
|
||||
import org.nl.wms.sch_manage.service.ISchBaseTaskService;
|
||||
@@ -20,6 +21,7 @@ import org.nl.wms.sch_manage.service.dao.SchBaseTask;
|
||||
import org.nl.wms.sch_manage.service.dao.SchBaseTaskconfig;
|
||||
import org.nl.wms.sch_manage.service.util.AbstractTask;
|
||||
import org.nl.wms.sch_manage.service.util.AcsTaskDto;
|
||||
import org.nl.wms.sch_manage.service.util.TaskUtils;
|
||||
import org.nl.wms.warehouse_manage.enums.IOSEnum;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.IOutBillService;
|
||||
import org.nl.wms.warehouse_manage.inAndOut.service.dao.IOStorInvDis;
|
||||
@@ -111,26 +113,26 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
if (status.equals(TaskStatus.EXECUTING)) {
|
||||
taskObj.setTask_status(TaskStatus.EXECUTING.getCode());
|
||||
taskObj.setRemark("执行中");
|
||||
TaskUtils.setUpdateByAcs(taskObj);
|
||||
taskService.updateById(taskObj);
|
||||
}
|
||||
if (status.equals(TaskStatus.FINISHED)) {
|
||||
this.finishTask(taskObj);
|
||||
this.finishTask(taskObj, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
}
|
||||
if (status.equals(TaskStatus.CANCELED)) {
|
||||
this.cancelTask(taskObj);
|
||||
this.cancelTask(taskObj, TaskFinishedTypeEnum.AUTO_ACS);
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelTask(SchBaseTask taskObj) {
|
||||
private void cancelTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
// 取消任务
|
||||
taskService.update(new LambdaUpdateWrapper<SchBaseTask>()
|
||||
.set(SchBaseTask::getTask_status, TaskStatus.CANCELED.getCode())
|
||||
.set(SchBaseTask::getRemark, "已取消")
|
||||
.eq(SchBaseTask::getTask_id, taskObj.getTask_id())
|
||||
);
|
||||
taskObj.setTask_status(TaskStatus.CANCELED.getCode());
|
||||
taskObj.setRemark("已取消");
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
|
||||
//分配表清除任务
|
||||
ioStorInvDisMapper.update(new IOStorInvDis(), new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
ioStorInvDisMapper.update(null, new LambdaUpdateWrapper<>(IOStorInvDis.class)
|
||||
.set(IOStorInvDis::getTask_id, null)
|
||||
.set(IOStorInvDis::getPoint_code, null)
|
||||
.set(IOStorInvDis::getIs_issued, 0)
|
||||
@@ -139,10 +141,11 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
);
|
||||
}
|
||||
|
||||
private void finishTask(SchBaseTask taskObj) {
|
||||
private void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) {
|
||||
// 任务完成
|
||||
taskObj.setTask_status(TaskStatus.FINISHED.getCode());
|
||||
taskObj.setRemark("已完成");
|
||||
TaskUtils.setUpdateByType(taskObj, taskFinishedType);
|
||||
taskService.updateById(taskObj);
|
||||
outBillService.taskFinish(taskObj);
|
||||
// 工单完成
|
||||
@@ -192,7 +195,7 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
if (ObjectUtil.isEmpty(taskObj)) {
|
||||
throw new BadRequestException("该任务不存在");
|
||||
}
|
||||
this.finishTask(taskObj);
|
||||
this.finishTask(taskObj, TaskFinishedTypeEnum.MANUAL_PC);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -204,7 +207,7 @@ public class JbUpAgvTask extends AbstractTask {
|
||||
if (!TaskStatus.CREATE.getCode().equals(taskObj.getTask_status())) {
|
||||
throw new BadRequestException("任务状态必须为生成才能取消任务");
|
||||
}
|
||||
this.cancelTask(taskObj);
|
||||
this.cancelTask(taskObj, TaskFinishedTypeEnum.MANUAL_PC);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -276,7 +276,7 @@
|
||||
<!--表格渲染-->
|
||||
<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="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />
|
||||
<!-- <el-table-column prop="workshop_code" label="车间编码" :min-width="flexWidth('workshop_code',crud.data,'车间编码')" />-->
|
||||
<el-table-column prop="point_code" label="点位编码" :min-width="flexWidth('point_code',crud.data,'点位编码')" />
|
||||
<el-table-column prop="point_name" label="点位名称" :min-width="flexWidth('point_name',crud.data,'点位名称')" />
|
||||
<el-table-column prop="region_code" label="区域编码" :min-width="flexWidth('region_code',crud.data,'区域编码')" />
|
||||
@@ -336,15 +336,15 @@
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
<el-button
|
||||
v-if="showButton(scope.row.point_status)"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-view"
|
||||
@click="toView(scope.row)"
|
||||
>
|
||||
查看详情
|
||||
</el-button>
|
||||
<!-- <el-button-->
|
||||
<!-- v-if="showButton(scope.row.point_status)"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-view"-->
|
||||
<!-- @click="toView(scope.row)"-->
|
||||
<!-- >-->
|
||||
<!-- 查看详情-->
|
||||
<!-- </el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
Reference in New Issue
Block a user