|
|
@ -4,12 +4,17 @@ import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.IdUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature; |
|
|
|
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.system.util.CodeUtil; |
|
|
|
import org.nl.modules.wql.WQL; |
|
|
|
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.sch.manage.*; |
|
|
|
|
|
|
@ -239,17 +244,17 @@ public class TaskUtils { |
|
|
|
/** |
|
|
|
* 生成喷码内容,祥见 SVN 项目文档信息。 |
|
|
|
* |
|
|
|
* @param vd 组盘对象 |
|
|
|
* @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("/"); |
|
|
@ -279,4 +284,45 @@ public class TaskUtils { |
|
|
|
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)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|