Merge branch 'master' of http://121.40.234.130:8899/root/liaoNingShengHua2
This commit is contained in:
@@ -0,0 +1,24 @@
|
|||||||
|
package org.nl.wms.cockpit.constant;
|
||||||
|
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 大屏常量类
|
||||||
|
*
|
||||||
|
* @author zhangjiangwei
|
||||||
|
* @date 2023/07/03 16:58
|
||||||
|
*/
|
||||||
|
public class CockpitConstants {
|
||||||
|
|
||||||
|
// 入窑输送线及窑内数据
|
||||||
|
public static CopyOnWriteArrayList<String> kilnData = new CopyOnWriteArrayList<>(new String[44]);
|
||||||
|
|
||||||
|
// 入窑输送线及窑内数据 redis key
|
||||||
|
public static final String KILN_DATA_KEY = "KILN_DATA_KEY";
|
||||||
|
|
||||||
|
// 冷却道数据
|
||||||
|
public static CopyOnWriteArrayList<String> coolingData = new CopyOnWriteArrayList<>(new String[46]);
|
||||||
|
|
||||||
|
// 冷却道数据 redis key
|
||||||
|
public static final String COOLING_DATA_KEY = "COOLING_DATA_KEY";
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
输入.workprocedure_ids TYPEAS f_string
|
输入.workprocedure_ids TYPEAS f_string
|
||||||
输入.unFinish TYPEAS s_string
|
输入.unFinish TYPEAS s_string
|
||||||
输入.region_code TYPEAS s_string
|
输入.region_code TYPEAS s_string
|
||||||
|
输入.device TYPEAS s_string
|
||||||
|
|
||||||
[临时表]
|
[临时表]
|
||||||
--这边列出来的临时表就会在运行期动态创建
|
--这边列出来的临时表就会在运行期动态创建
|
||||||
@@ -89,6 +89,9 @@
|
|||||||
ENDOPTION
|
ENDOPTION
|
||||||
OPTION 输入.region_code <> ""
|
OPTION 输入.region_code <> ""
|
||||||
device.region_code = 输入.region_code
|
device.region_code = 输入.region_code
|
||||||
|
ENDOPTION
|
||||||
|
OPTION 输入.device <> ""
|
||||||
|
device.device_name = 输入.device
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
ENDPAGEQUERY
|
ENDPAGEQUERY
|
||||||
@@ -241,6 +244,9 @@
|
|||||||
OPTION 输入.region_code <> ""
|
OPTION 输入.region_code <> ""
|
||||||
device.region_code = 输入.region_code
|
device.region_code = 输入.region_code
|
||||||
ENDOPTION
|
ENDOPTION
|
||||||
|
OPTION 输入.device <> ""
|
||||||
|
device.device_name = 输入.device
|
||||||
|
ENDOPTION
|
||||||
ORDER BY
|
ORDER BY
|
||||||
ShiftOrder.order_status ASC, ShiftOrder.create_time DESC
|
ShiftOrder.order_status ASC, ShiftOrder.create_time DESC
|
||||||
ENDSELECT
|
ENDSELECT
|
||||||
|
|||||||
@@ -4,15 +4,22 @@ 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.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
|
import org.nl.modules.common.utils.RedisUtils;
|
||||||
import org.nl.modules.common.utils.SecurityUtils;
|
import org.nl.modules.common.utils.SecurityUtils;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.modules.wql.WQL;
|
import org.nl.modules.wql.WQL;
|
||||||
import org.nl.modules.wql.core.bean.WQLObject;
|
import org.nl.modules.wql.core.bean.WQLObject;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
import org.nl.wms.cockpit.constant.CockpitConstants;
|
||||||
import org.nl.wms.common.PickType;
|
import org.nl.wms.common.PickType;
|
||||||
import org.nl.wms.sch.manage.*;
|
import org.nl.wms.sch.manage.*;
|
||||||
|
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 辽宁晟华任务工具类
|
* 辽宁晟华任务工具类
|
||||||
*
|
*
|
||||||
@@ -21,12 +28,6 @@ import org.nl.wms.sch.manage.*;
|
|||||||
*/
|
*/
|
||||||
public class TaskUtils {
|
public class TaskUtils {
|
||||||
|
|
||||||
public static void isEmptyPoint(JSONObject point) {
|
|
||||||
if (PointStatus.NOT_EMPTY.value().equals(point.getString("point_status"))) {
|
|
||||||
throw new BadRequestException("[" + point.getString("point_code") + "] 上有货!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void isNotEmptyPoint(JSONObject point) {
|
public static void isNotEmptyPoint(JSONObject point) {
|
||||||
if (PointStatus.EMPTY.value().equals(point.getString("point_status"))) {
|
if (PointStatus.EMPTY.value().equals(point.getString("point_status"))) {
|
||||||
throw new BadRequestException("[" + point.getString("point_code") + "] 上无货!");
|
throw new BadRequestException("[" + point.getString("point_code") + "] 上无货!");
|
||||||
@@ -233,4 +234,95 @@ public class TaskUtils {
|
|||||||
regionIn.put("cBatch", order_code);
|
regionIn.put("cBatch", order_code);
|
||||||
return regionIn;
|
return regionIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 字母表
|
||||||
|
static String[] alphabet = {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"};
|
||||||
|
|
||||||
|
// 喷码月份映射数组
|
||||||
|
static String[] month = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "N", "D"};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成喷码内容,祥见 SVN 项目文档信息。
|
||||||
|
*
|
||||||
|
* @param vd 组盘对象
|
||||||
|
* @param yjCode 压机编码
|
||||||
|
* @return 喷码内容
|
||||||
|
*/
|
||||||
|
public static String codingCode(JSONObject vd, String yjCode) {
|
||||||
|
try {
|
||||||
|
JSONObject material = WQLObject.getWQLObject("md_me_materialbase").query("material_id = " + vd.getString("material_id")).uniqueResult(0);
|
||||||
|
|
||||||
|
// 使用部位2位。从物料编码截取使用部位。
|
||||||
|
String partUsed = material.getString("material_code").substring(21, 23);
|
||||||
|
|
||||||
|
// 砖型5位。一般砖型如"22/30"不需要处理,但如果'/'右边到达了3位数,需要特殊处理成"1H"。
|
||||||
|
String brickType = material.getString("brick_type");
|
||||||
|
int slashIndex = brickType.lastIndexOf("/");
|
||||||
|
int brickTypeRight = Integer.parseInt(brickType.substring(slashIndex + 1));
|
||||||
|
if (brickTypeRight >= 100) {
|
||||||
|
int brickTypeLeft = Integer.parseInt(brickType.substring(0, slashIndex));
|
||||||
|
brickType = brickTypeLeft + "/" + "1H";
|
||||||
|
}
|
||||||
|
|
||||||
|
// 压机号1位,A代表1号压机,以此类推。从压机设备编码截取数字,例如"YJ07"截取"07",转换成数字后减去1即是压机对应字母在 alphabet 数组中的索引位置。
|
||||||
|
yjCode = alphabet[Integer.parseInt(Pattern.compile("[^0-9]").matcher(yjCode).replaceAll("").trim()) - 1];
|
||||||
|
|
||||||
|
// 混料机号1位,A代表1号混料机,以此类推。从混料机设备编码截取数字,例如"HLJ07"截取"07",转换成数字后减去1即是压机对应字母在 alphabet 数组中的索引位置。
|
||||||
|
JSONObject workOrder = WQLObject.getWQLObject("pdm_bd_workorder").query("workorder_id = " + vd.getString("workorder_id")).uniqueResult(0);
|
||||||
|
String hljCode = alphabet[Integer.parseInt(Pattern.compile("[^0-9]").matcher(workOrder.getString("device_code")).replaceAll("").trim()) - 1];
|
||||||
|
|
||||||
|
// 碾次2位。表里存储的是整数,对于少于2位的数字 String 简单格式化即可。
|
||||||
|
String mixNum = String.format("%02d", vd.getIntValue("mix_num"));
|
||||||
|
|
||||||
|
// 日期3位,第1位表示月,超过1位的'0'表示10月,'N'表示11月,'D'表示12月,后2位表示日,对于少于2位的日 String 简单格式化即可。
|
||||||
|
String date = month[DateUtil.thisMonth()] + String.format("%02d", DateUtil.thisDayOfMonth());
|
||||||
|
|
||||||
|
// 拼接字符串返回。
|
||||||
|
return partUsed + brickType + yjCode + hljCode + mixNum + date;
|
||||||
|
} catch (Exception ignore) {
|
||||||
|
// 如果报错返回 null。
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void inKiln(String vehicleCode) {
|
||||||
|
if (StrUtil.isBlank(CockpitConstants.kilnData.get(0))) {
|
||||||
|
CockpitConstants.kilnData.set(0, vehicleCode);
|
||||||
|
SpringContextHolder.getBean(RedisUtils.class).set(CockpitConstants.KILN_DATA_KEY, JSON.toJSONString(CockpitConstants.kilnData, SerializerFeature.WriteMapNullValue));
|
||||||
|
} else {
|
||||||
|
for (int i = CockpitConstants.kilnData.size() - 1; i > 0; i--) {
|
||||||
|
CockpitConstants.kilnData.set(i, CockpitConstants.kilnData.get(i - 1));
|
||||||
|
}
|
||||||
|
CockpitConstants.kilnData.set(0, vehicleCode);
|
||||||
|
SpringContextHolder.getBean(RedisUtils.class).set(CockpitConstants.KILN_DATA_KEY, JSON.toJSONString(CockpitConstants.kilnData, SerializerFeature.WriteMapNullValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void outKiln(String vehicleCode) {
|
||||||
|
if (vehicleCode.equals(CockpitConstants.kilnData.get(CockpitConstants.kilnData.size() - 1))) {
|
||||||
|
for (int i = CockpitConstants.kilnData.size() - 1; i > 0; i--) {
|
||||||
|
CockpitConstants.kilnData.set(i, CockpitConstants.kilnData.get(i - 1));
|
||||||
|
}
|
||||||
|
CockpitConstants.kilnData.set(0, null);
|
||||||
|
SpringContextHolder.getBean(RedisUtils.class).set(CockpitConstants.KILN_DATA_KEY, JSON.toJSONString(CockpitConstants.kilnData, SerializerFeature.WriteMapNullValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void inCooling(String vehicleCode) {
|
||||||
|
for (int i = CockpitConstants.coolingData.size() - 1; i > 0; i--) {
|
||||||
|
CockpitConstants.coolingData.set(i, CockpitConstants.coolingData.get(i - 1));
|
||||||
|
}
|
||||||
|
CockpitConstants.coolingData.set(0, vehicleCode);
|
||||||
|
SpringContextHolder.getBean(RedisUtils.class).set(CockpitConstants.COOLING_DATA_KEY, JSON.toJSONString(CockpitConstants.coolingData, SerializerFeature.WriteMapNullValue));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void outCooling(String vehicleCode) {
|
||||||
|
if (vehicleCode.equals(CockpitConstants.coolingData.get(CockpitConstants.coolingData.size() - 1))) {
|
||||||
|
for (int i = CockpitConstants.coolingData.size() - 1; i > 0; i--) {
|
||||||
|
CockpitConstants.coolingData.set(i, CockpitConstants.coolingData.get(i - 1));
|
||||||
|
}
|
||||||
|
CockpitConstants.coolingData.set(0, null);
|
||||||
|
SpringContextHolder.getBean(RedisUtils.class).set(CockpitConstants.COOLING_DATA_KEY, JSON.toJSONString(CockpitConstants.coolingData, SerializerFeature.WriteMapNullValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
server:
|
server:
|
||||||
port: 8010
|
port: 8010
|
||||||
|
tomcat:
|
||||||
|
accept-count: 1000
|
||||||
|
max-connections: 10000
|
||||||
|
max-threads: 800
|
||||||
|
min-spare-threads: 100
|
||||||
#配置数据源
|
#配置数据源
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: prod
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
data:
|
data:
|
||||||
|
|||||||
Reference in New Issue
Block a user