Merge remote-tracking branch 'origin/master_merge' into master_merge
This commit is contained in:
@@ -54,10 +54,10 @@ public class AutoSendVehicleToDjq {
|
||||
if (tryLock) {
|
||||
String pointCode2;
|
||||
JSONObject task = new JSONObject();
|
||||
List<BstIvtPackageinfoivt> ivtList =ibstIvtPackageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"),"");
|
||||
if (CollectionUtils.isNotEmpty(ivtList)) {
|
||||
return;
|
||||
}
|
||||
// List<BstIvtPackageinfoivt> ivtList =ibstIvtPackageinfoivtService.getBstIvtPackageinfoivts(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("合格品"),"");
|
||||
// if (CollectionUtils.isNotEmpty(ivtList)) {
|
||||
// return;
|
||||
// }
|
||||
//存在装箱区有空载具的点位
|
||||
List<BstIvtPackageinfoivt> zxqIvtList = packageinfoivtService.checkEndPointTask(PackageInfoIvtEnum.POINT_STATUS.code("装箱区"), PackageInfoIvtEnum.IVT_STATUS.code("空载具"), PackageInfoIvtEnum.TASK_POINT_TYPE.code("取货任务"), "", "");
|
||||
if (CollectionUtils.isEmpty(zxqIvtList)) {
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.nl.b_lms.storage_manage.database.service.dao.mapper.BstIvtBoxinfoMapp
|
||||
import org.nl.b_lms.storage_manage.ios.enums.IOSEnum;
|
||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
import org.nl.system.service.param.ISysParamService;
|
||||
import org.nl.wms.ext.mes.service.impl.LmsToMesServiceImpl;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
@@ -50,10 +51,13 @@ import static org.nl.wms.util.TaskUtil.getMaxNum;
|
||||
public class AutoSendZxToDjw {
|
||||
private final String THIS_CLASS = AutoSendZxToDjw.class.getName();
|
||||
|
||||
private Integer NUM = 0;
|
||||
private final Integer NUM = 0;
|
||||
private static final String NUM_KEY = "AutoSendZxToDjw:NUM";
|
||||
|
||||
private final RedissonClient redissonClient;
|
||||
@Resource
|
||||
private RedisUtils redisUtils;
|
||||
@Resource
|
||||
private IschBaseTaskService taskService;
|
||||
@Resource
|
||||
private ZxDjwTask zxDjwTask;
|
||||
@@ -157,15 +161,25 @@ public class AutoSendZxToDjw {
|
||||
//param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
||||
//todo 木箱计划放入子卷数量,暂时默认1
|
||||
param.put("boxNo", relationList.get(0).getQuanlity_in_box());
|
||||
NUM = NUM + 1;
|
||||
if (NUM == Integer.parseInt(bstIvtBoxinfo.getNum())) {
|
||||
//todo 查询是否为最后一个子卷,暂时默认1
|
||||
Integer num = getNumFromRedis();
|
||||
num = num + 1;
|
||||
if (num.equals(Integer.parseInt(bstIvtBoxinfo.getNum()))) {
|
||||
param.put("lastOne", IOSEnum.IS_NOTANDYES.code("是"));
|
||||
NUM = 0;
|
||||
num = 0;
|
||||
} else {
|
||||
//todo 查询是否为最后一个子卷,暂时默认1
|
||||
param.put("lastOne", IOSEnum.IS_NOTANDYES.code("否"));
|
||||
}
|
||||
// 更新计数
|
||||
redisUtils.set(NUM_KEY, num);
|
||||
//NUM = NUM + 1;
|
||||
// if (NUM == Integer.parseInt(bstIvtBoxinfo.getNum())) {
|
||||
// //todo 查询是否为最后一个子卷,暂时默认1
|
||||
// param.put("lastOne", IOSEnum.IS_NOTANDYES.code("是"));
|
||||
// NUM = 0;
|
||||
// } else {
|
||||
// //todo 查询是否为最后一个子卷,暂时默认1
|
||||
// param.put("lastOne", IOSEnum.IS_NOTANDYES.code("否"));
|
||||
// }
|
||||
jo.put("request_param", param.toString());
|
||||
zxDjwTask.createTask(jo);
|
||||
// try {
|
||||
@@ -342,7 +356,13 @@ public class AutoSendZxToDjw {
|
||||
return height;
|
||||
}
|
||||
|
||||
|
||||
private Integer getNumFromRedis() {
|
||||
Object numObj = redisUtils.get(NUM_KEY);
|
||||
if (numObj == null) {
|
||||
return 0;
|
||||
}
|
||||
return (Integer) numObj;
|
||||
}
|
||||
|
||||
|
||||
// void sendMzqToDjq() {
|
||||
|
||||
@@ -210,12 +210,11 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
break;
|
||||
}
|
||||
JSONObject cache_map = new JSONObject();
|
||||
cache_map.put("flag", "1");
|
||||
cache_map.put("flag", "4");
|
||||
cache_map.put("reging_id", reging_id);
|
||||
cache_map.put("point_location", jsonSb.getString("point_location"));
|
||||
//只找入箱点位
|
||||
cache_map.put("point_type", "4");
|
||||
cache_map.put("mater_flag", "1");
|
||||
|
||||
JSONObject point_code2_jo = WQL.getWO("PDA_OVENINANDOUT_01").addParamMap(cache_map).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(point_code2_jo)) {
|
||||
@@ -272,8 +271,9 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
}
|
||||
|
||||
// 更新工单状态
|
||||
jsonRaw.put("status", "02");
|
||||
pdmBiRawfoilworkorderService.update(jsonRaw);
|
||||
JSONObject jo_map = new JSONObject();
|
||||
jo_map.put("status", "02");
|
||||
pdmBiRawfoilworkorderService.update(jo_map, "workorder_id = '" + raw_jo.getString("workorder_id") + "'");
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
@@ -494,8 +494,9 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
}
|
||||
|
||||
// 更新工单状态为确认下卷
|
||||
jsonRaw.put("status", "03");
|
||||
pdmBiRawfoilworkorderService.update(jsonRaw);
|
||||
JSONObject update_jo = new JSONObject();
|
||||
update_jo.put("status", "03");
|
||||
pdmBiRawfoilworkorderService.update(update_jo, ("workorder_id = '" + raw_jo.getString("workorder_id") + "'"));
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("message", "操作成功!");
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
输入.point_type TYPEAS s_string
|
||||
输入.cant_location TYPEAS f_string
|
||||
输入.mater_flag TYPEAS s_string
|
||||
输入.mater_flag TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -285,4 +286,30 @@
|
||||
ORDER BY num,a.point_code
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "4"
|
||||
QUERY
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_point po
|
||||
WHERE
|
||||
is_used = '1'
|
||||
AND IFNULL(po.material_code,'') = ''
|
||||
AND po.reging_id = 输入.reging_id
|
||||
AND po.point_location = 输入.point_location
|
||||
AND NOT EXISTS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code2 = point_code OR point_code4 = point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
ORDER BY sort_seq desc
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
@@ -225,7 +225,7 @@ IF 输入.flag = "6"
|
||||
FROM
|
||||
sch_base_task
|
||||
WHERE
|
||||
( point_code1 = ivt.full_point_code OR point_code4 = ivt.full_point_code )
|
||||
( point_code1 = ivt.empty_point_code OR point_code4 = ivt.empty_point_code )
|
||||
AND task_status < '07'
|
||||
AND is_delete = '0'
|
||||
)
|
||||
|
||||
@@ -212,9 +212,20 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
// 判断木箱毛重是否超标
|
||||
if (NumberUtil.sub(box_weight, weight_sys) <= real_weight && NumberUtil.add(box_weight, weight_sys) >= real_weight) {
|
||||
} else {
|
||||
//调用ACS让对应蜂鸣器报警
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("code", "to_command");
|
||||
param.put("product_area", "BLK");
|
||||
param.put("value", "99");
|
||||
param.put("device_code", point_code);
|
||||
JSONArray rows = new JSONArray();
|
||||
rows.add(param);
|
||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||
wmsToAcsService.action(rows);
|
||||
|
||||
// 将木箱重量告知飞书
|
||||
notifyMes(sub_jo);
|
||||
throw new BadRequestException("重量不合格!系统重量浮动超过"+weight_sys+"KG,当前木称重重量:"+real_weight);
|
||||
throw new BadRequestException("重量不合格!系统重量浮动超过" + weight_sys + "KG,当前木称重重量:" + real_weight);
|
||||
}
|
||||
|
||||
//判断是该包装计划是否存在长宽高
|
||||
@@ -279,13 +290,13 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
String download_attr_num = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("download_attr_num").getValue();
|
||||
|
||||
// 校验仓位数是否满足
|
||||
if(box_high <= Double.parseDouble(in_download_box_high)) {
|
||||
if (box_high <= Double.parseDouble(in_download_box_high)) {
|
||||
JSONObject jsonOne = attrList.stream()
|
||||
.filter(row -> row.getString("layer_num").equals("1"))
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (jsonOne.getDoubleValue("num") <= Double.parseDouble(download_attr_num)) {
|
||||
throw new BadRequestException(jsonOne.getString("layer_num") + "层主存区仓位数不足" + download_attr_num +"个,不允许入库!");
|
||||
throw new BadRequestException(jsonOne.getString("layer_num") + "层主存区仓位数不足" + download_attr_num + "个,不允许入库!");
|
||||
}
|
||||
} else {
|
||||
List<JSONObject> layerList = attrList.stream()
|
||||
@@ -297,7 +308,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
.findFirst().orElse(null);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAttr)) {
|
||||
throw new BadRequestException(jsonAttr.getString("layer_num") + "层主存区仓位数不足" + download_attr_num +"个,不允许入库!");
|
||||
throw new BadRequestException(jsonAttr.getString("layer_num") + "层主存区仓位数不足" + download_attr_num + "个,不允许入库!");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -610,23 +621,24 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
if (NumberUtil.sub(box_weight, weight_sys) <= weight_now && NumberUtil.add(box_weight, weight_sys) >= weight_now) {
|
||||
// 校验重量上下付浮动是否超过2
|
||||
if (NumberUtil.sub(box_weight, weight_sys_2) <= weight_now && NumberUtil.add(box_weight, weight_sys_2) >= weight_now) {
|
||||
jo.put("message", "重量合格!当前称重重量:"+weight_now);
|
||||
jo.put("message", "重量合格!当前称重重量:" + weight_now);
|
||||
} else {
|
||||
jo.put("message", "重量警告!系统重量浮动超过"+weight_sys_2+"KG,当前称重重量:"+weight_now);
|
||||
jo.put("message", "重量警告!系统重量浮动超过" + weight_sys_2 + "KG,当前称重重量:" + weight_now);
|
||||
}
|
||||
} else {
|
||||
jo.put("message", "重量不合格!系统重量浮动超过"+weight_sys+"KG,当前称重重量:"+weight_now);
|
||||
jo.put("message", "重量不合格!系统重量浮动超过" + weight_sys + "KG,当前称重重量:" + weight_now);
|
||||
|
||||
}
|
||||
// 更新当前木箱实际重量
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("real_weight",weight_now);
|
||||
subTab.update(json,"package_box_sn = '"+box_no+"'");
|
||||
json.put("real_weight", weight_now);
|
||||
subTab.update(json, "package_box_sn = '" + box_no + "'");
|
||||
return jo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成输送任务时通知木箱重量不合格
|
||||
*
|
||||
* @param sub_jo {子卷包装关系对象}
|
||||
*/
|
||||
private void notifyMes(JSONObject sub_jo) {
|
||||
@@ -659,7 +671,7 @@ public class ProductInstorServiceImpl implements ProductInstorService {
|
||||
double real_weight = NumberUtil.round(sub_jo.getDoubleValue("real_weight"), 2).doubleValue();
|
||||
|
||||
content.put("title", "【LMS通知】木箱超重警告");
|
||||
content.put("Message", "木箱号:"+sub_jo.getString("package_box_sn")+",系统木箱重量:"+box_weight+"KG,实际木箱重量:"+real_weight+"KG");
|
||||
content.put("Message", "木箱号:" + sub_jo.getString("package_box_sn") + ",系统木箱重量:" + box_weight + "KG,实际木箱重量:" + real_weight + "KG");
|
||||
param.put("card", content);
|
||||
|
||||
// 调用mes接口
|
||||
|
||||
@@ -69,7 +69,6 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTaskStatus(JSONObject taskObj, String status) {
|
||||
WQLObject taskTab = WQLObject.getWQLObject("SCH_BASE_Task"); // 任务表
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("ST_IVT_CoolPointIvt"); // 冷却区库存表
|
||||
@@ -87,16 +86,16 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
//更新车号和重量
|
||||
String car_no = taskObj.getString("car_no");
|
||||
if (StrUtil.isNotEmpty(car_no)) {
|
||||
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
|
||||
jsonRaw.put("agvno", car_no);
|
||||
rawTab.update(jsonRaw);
|
||||
JSONObject update_jo = new JSONObject();
|
||||
update_jo.put("agvno", car_no);
|
||||
rawTab.update(update_jo, "container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
|
||||
}
|
||||
// 更新生箔工单称重信息
|
||||
String weight = taskObj.getString("weight");
|
||||
if (ObjectUtil.isNotEmpty(weight)) {
|
||||
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
|
||||
jsonRaw.put("productin_qty", weight);
|
||||
rawTab.update(jsonRaw);
|
||||
JSONObject update_jo = new JSONObject();
|
||||
update_jo.put("productin_qty", weight);
|
||||
rawTab.update(update_jo, "container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
|
||||
}
|
||||
if (StrUtil.equals(status, "0")) {
|
||||
// 更新删除字段
|
||||
@@ -106,9 +105,10 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
|
||||
// 更新生箔工单状态为开始、清除称重信息
|
||||
JSONObject jsonRaw = rawTab.query("container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'").uniqueResult(0);
|
||||
jsonRaw.put("status", "01");
|
||||
jsonRaw.put("productin_qty", 0);
|
||||
rawTab.update(jsonRaw);
|
||||
JSONObject update_jo = new JSONObject();
|
||||
update_jo.put("status", "01");
|
||||
update_jo.put("productin_qty", 0);
|
||||
rawTab.update(update_jo, "container_name ='" + jsonTask.getString("material_code") + "' AND status <> '09' AND is_delete = '0'");
|
||||
}
|
||||
|
||||
if (TaskStatusEnum.EXECUTING.getCode().equals(status)) {
|
||||
@@ -185,11 +185,6 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
throw new BadRequestException("终点未找到可用点位:" + point_code2);
|
||||
}
|
||||
|
||||
// 更新点位库存状态
|
||||
jsonIvt2.put("point_status", "2");
|
||||
jsonIvt2.put("material_code", jsonTask.getString("material_code"));
|
||||
point_tab.update(jsonIvt2);
|
||||
|
||||
//创建桁架任务将子卷搬运到桁架下的半成品缓存位
|
||||
//查询当前点位为空且没有任务的桁架内缓存点
|
||||
JSONObject cache_param = new JSONObject();
|
||||
@@ -197,7 +192,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
cache_param.put("point_location", jsonIvt.getString("point_location"));
|
||||
cache_param.put("product_area", jsonIvt.getString("product_area"));
|
||||
JSONObject cache_jo = WQL.getWO("PDA_COOLIN").addParamMap(cache_param).process().uniqueResult(0);
|
||||
if(ObjectUtil.isEmpty(cache_jo)) {
|
||||
if (ObjectUtil.isEmpty(cache_jo)) {
|
||||
throw new BadRequestException("未查询到可用的冷却区暂存位!");
|
||||
}
|
||||
JSONObject param = new JSONObject();
|
||||
@@ -208,6 +203,11 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
param.put("type", "3");
|
||||
InHotTask inHotTask = SpringContextHolder.getBean(InHotTask.class);
|
||||
inHotTask.createTask(param);
|
||||
|
||||
// 更新点位库存状态
|
||||
jsonIvt2.put("point_status", "2");
|
||||
jsonIvt2.put("material_code", jsonTask.getString("material_code"));
|
||||
point_tab.update(jsonIvt2);
|
||||
} else {
|
||||
// 校验终点是否存在
|
||||
JSONObject jsonIvt2 = ivtTab.query("full_point_code ='" + point_code4 + "'").uniqueResult(0);
|
||||
@@ -227,15 +227,16 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
WQLObject.getWQLObject("PDM_BI_RawFoilWorkOrder").update(map, "container_name = '" + jsonTask.getString("material_code") + "'");
|
||||
|
||||
// 更新冷却库存状态
|
||||
jsonIvt2.put("full_point_status", "02");
|
||||
jsonIvt2.put("instorage_time", DateUtil.now());
|
||||
jsonIvt2.put("container_name", jsonRaw.getString("container_name"));
|
||||
jsonIvt2.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
jsonIvt2.put("ivt_qty", jsonRaw.getString("productin_qty"));
|
||||
jsonIvt2.put("cool_ivt_status", "01");
|
||||
ivtTab.update(jsonIvt2);
|
||||
JSONObject cache_param = new JSONObject();
|
||||
cache_param.put("full_point_status", "02");
|
||||
cache_param.put("instorage_time", DateUtil.now());
|
||||
cache_param.put("container_name", jsonRaw.getString("container_name"));
|
||||
cache_param.put("workorder_id", jsonRaw.getString("workorder_id"));
|
||||
cache_param.put("ivt_qty", jsonRaw.getString("productin_qty"));
|
||||
cache_param.put("cool_ivt_status", "01");
|
||||
ivtTab.update(cache_param, "full_point_code ='" + point_code4 + "'");
|
||||
|
||||
// 插入入库单
|
||||
/*// 插入入库单
|
||||
JSONObject jsonMater = WQLObject.getWQLObject("md_me_materialbase").query("material_code = '" + jsonRaw.getString("product_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonMater)) {
|
||||
throw new BadRequestException("产品不存在");
|
||||
@@ -265,7 +266,7 @@ public class CallEmpReelTask extends AbstractAcsTask {
|
||||
jsonRegion.put("confirm_optid", currentUserId);
|
||||
jsonRegion.put("confirm_optname", currentUsername);
|
||||
jsonRegion.put("confirm_time", DateUtil.now());
|
||||
coolTab.insert(jsonRegion);
|
||||
coolTab.insert(jsonRegion);*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@
|
||||
<el-table-column prop="vehicle_code" label="载具编码1" width="130" show-overflow-tooltip />
|
||||
<el-table-column prop="vehicle_code2" label="载具编码2" width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="request_param" label="请求参数" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="response_param" label="返回参数" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="response_param" label="响应参数" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="task_name" label="任务描述" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="create_name" label="创建人" width="135" show-overflow-tooltip />
|
||||
<el-table-column prop="create_time" label="创建时间" width="135" show-overflow-tooltip />
|
||||
|
||||
Reference in New Issue
Block a user