fix: 调试中出现的问题2

This commit is contained in:
2025-03-29 14:37:02 +08:00
parent f8081c4949
commit 867e99bd23
24 changed files with 494 additions and 116 deletions

View File

@@ -15,4 +15,6 @@ public interface StIvtShaftivtMapper extends BaseMapper<StIvtShaftivt> {
List<StIvtShaftivt> getCachePointNoTask(String productArea);
List<StIvtShaftivt> getCanUsePoint(String qzzSize, String qzzGeneration, String productArea);
}

View File

@@ -7,4 +7,15 @@
WHERE s.point_type = '11' AND s.have_qzz = '0' AND s.is_used = '1' AND s.product_area = #{productArea}
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.point_code2 = s.point_code AND t.task_status <![CDATA[ < ]]> '07' AND t.is_delete = '0')
</select>
<select id="getCanUsePoint" resultType="org.nl.b_lms.sch.point.dao.StIvtShaftivt">
SELECT
*
FROM
`st_ivt_shaftivt` ss
WHERE ss.point_type = '1' AND ss.product_area = #{productArea}
AND ss.is_used = '1' AND ss.have_qzz = '1'
AND ss.qzz_size = #{qzzSize} AND ss.qzz_generation = #{qzzGeneration}
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[ < ]]> '07'
AND t.point_code1 = ss.point_code AND t.is_delete = '0')
</select>
</mapper>

View File

@@ -59,6 +59,8 @@ public interface IstIvtShaftivtService extends IService<StIvtShaftivt> {
* @return
*/
List<StIvtShaftivt> getCachePointNoTask(String productArea);
List<StIvtShaftivt> getCanUsePoint(String qzzSize, String qzzGeneration, String productArea);
}

View File

@@ -87,6 +87,11 @@ public class StIvtShaftivtServiceImpl extends ServiceImpl<StIvtShaftivtMapper, S
return stIvtShaftivtMapper.getCachePointNoTask(productArea);
}
@Override
public List<StIvtShaftivt> getCanUsePoint(String qzzSize, String qzzGeneration, String productArea) {
return stIvtShaftivtMapper.getCanUsePoint(qzzSize, qzzGeneration, productArea);
}
/**
* 获取实体基础信息

View File

@@ -87,6 +87,16 @@ public interface IschBaseTaskService extends IService<SchBaseTask> {
*/
List<SchBaseTask> getAllTaskByTypeAndStatus(String taskType, String taskStatus);
/**
* 根据任务类型与小于(等于)状态获取任务数据
* @param taskType 类型
* @param taskStatus 状态
* @param productArea 区域
* @param isEqual 是否等于
* @return
*/
List<SchBaseTask> getAllTaskByTypeAndLtStatus(String taskType, String taskStatus, String productArea, boolean isEqual);
/**
* 查找暂存位置是否有任务,包括桁架任务
* @param point /

View File

@@ -155,6 +155,17 @@ public class SchBaseTaskServiceImpl extends ServiceImpl<SchBaseTaskMapper, SchBa
return list(queryWrapper);
}
@Override
public List<SchBaseTask> getAllTaskByTypeAndLtStatus(String taskType, String taskStatus, String productArea, boolean isEqual) {
LambdaQueryWrapper<SchBaseTask> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.lt(!isEqual, SchBaseTask::getTask_status, taskStatus)
.le(isEqual, SchBaseTask::getTask_status, taskStatus)
.eq(SchBaseTask::getProduct_area, productArea)
.eq(SchBaseTask::getIs_delete, IOSEnum.IS_NOTANDYES.code(""))
.eq(SchBaseTask::getTask_type, taskType);
return list(queryWrapper);
}
@Override
public Boolean checkHaveTaskByZcPoint(BstIvtCutpointivt point) {
LambdaQueryWrapper<SchBaseTask> lam = new QueryWrapper<SchBaseTask>().lambda();

View File

@@ -51,6 +51,7 @@ import org.nl.system.service.notice.ISysNoticeService;
import org.nl.system.service.param.ISysParamService;
import org.nl.system.service.param.impl.SysParamServiceImpl;
import org.nl.wms.ext.acs.service.AcsToWmsService;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.pda.mps.service.CasingService;
import org.nl.wms.pda.mps.service.ShippingService;
@@ -166,6 +167,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
private ProductOutTwoService productOutTwoService;
private final IstIvtCutpointivtService cutpointivtService;
private final WmsToAcsService wmsToAcsService;
/**
@@ -1236,13 +1238,23 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 套轴完成
if ("7".equals(type)) {
JSONObject task_resq = task_jo2.getJSONObject("request_param");
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + task_resq.getString("container_name1") + "' AND is_delete = '0'").uniqueResult(0);
String container_name1;
String container_name2;
// 如果给不到任务,就从套管共为获取
if (ObjectUtil.isNotEmpty(task_jo2)) {
JSONObject task_resq = task_jo2.getJSONObject("request_param");
//更新分切计划
container_name1 = task_resq.getString("container_name1");
container_name2 = task_resq.getString("container_name2");
} else {
JSONObject device_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_code = '" + device_code + "'").uniqueResult(0);
container_name1 = device_jo.getString("container_name1");
container_name2 = device_jo.getString("container_name2");
}
JSONObject plan_jo = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name = '" + container_name1 + "' AND is_delete = '0'").uniqueResult(0);
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("ext_code = '" + plan_jo.getString("resource_name") + "'").uniqueResult(0);
String point_location = cut_jo.getString("point_location");
//更新分切计划
String container_name1 = task_resq.getString("container_name1");
String container_name2 = task_resq.getString("container_name2");
JSONArray rows = new JSONArray();
String qzzno = "";
if (StrUtil.isNotEmpty(container_name1)) {
@@ -1287,10 +1299,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jo.put("point_code1", tggw_jo.getString("point_code"));
jo.put("point_code2", in_jo.getString("point_code"));
JSONObject request_param = new JSONObject();
request_param.put("container_name1", task_resq.getString("container_name1"));
request_param.put("container_name2", task_resq.getString("container_name2"));
request_param.put("container_name1", container_name1);
request_param.put("container_name2", container_name2);
jo.put("request_param", request_param);
jo.put("vehicle_code", task_resq.getString("container_name1"));
jo.put("vehicle_code", container_name1);
jo.put("product_area", product_area);
paperTrussTask.createTask(jo);
result.put("status", HttpStatus.OK.value());
@@ -1302,8 +1314,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//todo:如果缓存位有可用库位,创建一个桁架任务从穿拔轴位到缓存位,否则不动
JSONObject tz_jo = WQLObject.getWQLObject("st_ivt_shaftivt")
.query("product_area = '" + product_area +
"' AND point_type = '2" +
"' AND have_qzz = '0'" + " AND is_used = '1'" +
"' AND (point_type = '2" +
"' OR point_type = '11') AND have_qzz = '0'" + " AND is_used = '1'" +
" order by sort_seq").uniqueResult(0);
if (ObjectUtil.isNotEmpty(tz_jo)) {
JSONObject jo = new JSONObject();
@@ -1312,15 +1324,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jo.put("point_code1", tggw_jo.getString("point_code"));
jo.put("point_code2", tz_jo.getString("point_code"));
jo.put("product_area", product_area);
jo.put("vehicle_code", task_resq.getString("container_name1"));
jo.put("vehicle_code", container_name1);
jo.put("truss_type", "1");
JSONObject request_param = new JSONObject();
request_param.put("temp", "2");
request_param.put("need_size", cbz_size);
request_param.put("need_generation", cbz_generation);
request_param.put("need_location", point_location);
request_param.put("container_name1", task_resq.getString("container_name1"));
request_param.put("container_name2", task_resq.getString("container_name2"));
request_param.put("container_name1", container_name1);
request_param.put("container_name2", container_name2);
jo.put("request_param", request_param.toString());
paperTrussTask.createTask(jo);
@@ -1328,6 +1340,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
result.put("message", "反馈成功!");
return result;
} else {
// 如果都没位置就创建半条任务到in点托盘过来之后自动创建回去
JSONObject jo = new JSONObject();
jo.put("task_type", "010606");
JSONObject tggw_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '4'").uniqueResult(0);
@@ -1336,16 +1349,16 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
jo.put("point_code1", tggw_jo.getString("point_code"));
jo.put("point_code2", in_jo.getString("point_code"));
jo.put("product_area", product_area);
jo.put("vehicle_code", task_resq.getString("container_name1"));
jo.put("vehicle_code", container_name1);
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
jo.put("material_code", task_resq.getString("container_name1"));
jo.put("material_code", container_name1);
JSONObject request_param = new JSONObject();
request_param.put("temp", "2");
request_param.put("need_size", cbz_size);
request_param.put("need_generation", cbz_generation);
request_param.put("need_location", point_location);
request_param.put("container_name1", task_resq.getString("container_name1"));
request_param.put("container_name2", task_resq.getString("container_name2"));
request_param.put("container_name1", container_name1);
request_param.put("container_name2", container_name2);
jo.put("request_param", request_param.toString());
jo.put("handle_class", PaperTrussTask.class.getName());
jo.put("create_time", DateUtil.now());
@@ -1367,6 +1380,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String need_generation = request_param.getString("need_generation");
String have_size = request_param.getString("have_size");
String have_generation = request_param.getString("have_generation");
String new_point = "";
JSONObject struct_jo = new JSONObject();
// 申请取货
@@ -1405,21 +1419,51 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
.process().uniqueResult(0);
if (ObjectUtil.isEmpty(struct_jo)) {
// todo: 没有位置,需要送到对应的分切车间???
throw new BadRequestException("未查询到可用的点位!");
// todo: 没有位置,拉到人工RGV上由人工处理
// throw new BadRequestException("未查询到可用的点位!");
String rgvDevice = product_area + "_RG_RGV";
// 判断人工RGV是否有东西
JSONArray device_rows = new JSONArray();
JSONObject device_obj = new JSONObject();
device_rows.add(device_obj);
device_obj.put("device_code", rgvDevice);
device_obj.put("product_area", product_area);
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
throw new BadRequestException("获取人工RGV信息失败");
}
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
if (data2.getString("move2").equals("1")) {
throw new BadRequestException("人工RGV有货需要尽快处理");
}
// 通知RGV进去
JSONArray action_rows = new JSONArray();
JSONObject action_jo = new JSONObject();
action_jo.put("device_code", rgvDevice);
action_jo.put("code", "to_command");
action_jo.put("product_area", product_area);
action_jo.put("value", "1");
action_rows.add(action_jo);
JSONObject action = wmsToAcsService.action(action_rows);
if (!action.getString("status").equals("200")) {
throw new BadRequestException("该区域人工RGV异常");
}
new_point = rgvDevice;
} else {
new_point = struct_jo.getString("point_code");
}
//更新任务
if ("010603".equals(task_jo.getString("task_type")) || "010604".equals(task_jo.getString("task_type"))) {
if(!task_jo.getString("point_code2").contains("FHD")) {
return result;
}
task_jo.put("point_code2", struct_jo.getString("point_code"));
task_jo.put("point_code2", new_point);
}
if ("010606".equals(task_jo.getString("task_type"))) {
if(!task_jo.getString("point_code1").contains("FHD")) {
return result;
}
task_jo.put("point_code1", struct_jo.getString("point_code"));
task_jo.put("point_code1", new_point);
}
result.put("version", have_generation);
@@ -1428,6 +1472,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// 反馈尺寸
if ("2".equals(type)) {
String size = whereJson.getString("size");
if ("0".equals(size)) {
return result;
}
JSONObject request_jo = task_jo.getJSONObject("request_param");
request_jo.put("have_size", size);
task_jo.put("request_param", request_jo);
@@ -1517,11 +1564,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
task_jo.put("update_optid", SecurityUtils.getCurrentUserId());
task_jo.put("update_optname", SecurityUtils.getCurrentNickName());
task_jo.put("task_status", TaskStatusEnum.FINISHED.getCode());
WQLObject.getWQLObject("sch_base_task").update(task_jo);
}
log.info("即将更新的任务参数:{}", task_jo);
WQLObject.getWQLObject("sch_base_task").update(task_jo);
result.put("status", HttpStatus.OK.value());
result.put("device_code", struct_jo.getString("point_code"));
result.put("device_code", ObjectUtil.isEmpty(struct_jo) ? new_point : struct_jo.getString("point_code"));
result.put("message", "反馈成功!");
log.info("sendGetGoalStruct输出参数为--------------------------" + result.toString());
return result;
@@ -1603,6 +1650,10 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String task_code = whereJson.getString("task_code1");
WQLObject ivt_shaftivt = WQLObject.getWQLObject("st_ivt_shaftivt");
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "反馈成功!");
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_code = '" + task_code + "'").uniqueResult(0);
String point_type = task_jo.getString("task_type");
//取货完成
@@ -1611,7 +1662,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
point1_jo.put("have_qzz", "0");
ivt_shaftivt.update(point1_jo);
} else if ("010607".equals(point_type) || "010603".equals(point_type) || "010606".equals(point_type)) {
} else if ("010607".equals(point_type) || "010603".equals(point_type) || "010606".equals(point_type)|| "010601".equals(point_type)) {
JSONObject point1_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
if (point1_jo.getString("point_type").equals("1")) {
point1_jo.put("have_qzz", "0");
@@ -1640,13 +1691,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
//横移完成
if ("3".equals(type)) {
// task_jo托盘到out的任务|剩余轴回库
String product_area = task_jo.getString("product_area");
// 如果有下发的取轴桁架任务,则跳过
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
.eq(SchBaseTask::getProduct_area, product_area)
.eq(SchBaseTask::getIs_delete, "0")
.ne(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(SchBaseTask::getTask_type, "010606")
.gt(SchBaseTask::getTask_status, TaskStatusEnum.SURE_START.getCode()));
if (list.size() > 0) {
return result;
}
//判断对应的内包间区域是否启用
JSONObject pack_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '9' AND product_area = '" + product_area + "'").uniqueResult(0);
if ((task_jo.getString("task_type").equals("010401") || task_jo.getString("task_type").equals("010409")) && pack_jo.getString("is_used").equals("1")) {
String vehicle_code = task_jo.getString("vehicle_code2");
log.info("内包间托盘{}正在执行横移完毕操作!", vehicle_code);
// 托盘属性
JSONObject vehicle_jo = WQLObject.getWQLObject("md_pb_vehiclearea").query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
log.info("对应的托盘信息:{}", vehicle_jo);
// 托盘所对应的区域位置
String point_location = vehicle_jo.getString("point_location");
// in点位置
@@ -1693,6 +1757,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
// JSONObject tggw_task = WQLObject.getWQLObject("sch_base_task").query("point_code1 = '"+tggw_jo.getString("point_code")+"' AND task_type = '010607' AND is_delete = '0' ADN task_status < '07'").uniqueResult(0);
//判断在等待任务数量范围内是否存在符合的纸管,如果存在则等待,不存在则创建空载具入库任务
boolean need_wait = this.judgeWait(product_area, vehicle_jo);
log.info("判断托盘是否停留的结果:{}", need_wait);
if (!need_wait) {
//未查询到需要搬运的气胀轴,创建空载具入库任务
ShippingService shippingService = SpringContextHolder.getBean(ShippingService.class);
@@ -1707,9 +1772,6 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
}
}
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "反馈成功!");
return result;
}
@@ -1735,6 +1797,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
int limit_num = Integer.parseInt(task_num);
//判断当前可用的空位是多少MAX=54个缓存货架+1个套管工位
JSONArray hchj_ja = WQLObject.getWQLObject("st_ivt_shaftivt").query("product_area = '" + product_area + "' AND point_type = '2' AND is_used = '1' AND have_qzz = '0'").getResultJSONArray(0);
// 纸管取货任务,套管工位->架子
JSONObject task_jo = WQLObject.getWQLObject("sch_base_task").query("task_type = '010607' AND product_area = '" + product_area + "' AND is_delete = '0' AND task_status < '07'").uniqueResult(0);
int min_num = 0;
if (ObjectUtil.isNotEmpty(task_jo)) {
@@ -1752,17 +1815,32 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
// 判断当前托盘区域位置与当前即将套轴的位置是否一致,一致则等待
if (RenUtils.isOpenTempArea(product_area) && !need_wait) {
if (RenUtils.isOpenTzArea(product_area) && !need_wait) {
JSONObject tggw_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '4' AND product_area = '" + product_area + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(tggw_jo.getString("container_name1"))) {
return need_wait;
}
PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(tggw_jo.getString("tube_code1"));
PdmBiSlittingproductionplan plan = slittingproductionplanService.getByContainerName(tggw_jo.getString("container_name1"));
// 查询设备
StIvtCutpointivt device = cutpointivtService.getPintByExtCode(plan.getResource_name(), false);
if (device.getPoint_location().equals(point_location)) {
need_wait = true;
}
// 如果有取轴任务,则不回去。
if (!need_wait) {
List<SchBaseTask> gxTasks = taskService.getAllTaskByTypeAndLtStatus("010606", "07", product_area, false);
// 获取对应位置
List<SchBaseTask> needLocation = gxTasks.stream().filter(task -> {
JSONObject requestParam = JSONObject.parseObject(task.getRequest_param());
if (ObjectUtil.isEmpty(requestParam)) {
return false;
}
return point_location.equals(requestParam.getString("need_location"));
}).collect(Collectors.toList());
if (needLocation.size() > 0) {
need_wait = true;
}
}
}
return need_wait;

View File

@@ -80,5 +80,11 @@ public class PaperTubeController {
public ResponseEntity<Object> remainShaftBack(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(paperTubeService.remainShaftBack(whereJson), HttpStatus.OK);
}
@PostMapping("/startIntoTube")
@Log("一期开始套轴")
@SaIgnore
public ResponseEntity<Object> startIntoTube(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(paperTubeService.startIntoTube(whereJson), HttpStatus.OK);
}
}

View File

@@ -71,4 +71,11 @@ public interface PaperTubeService {
* @return
*/
JSONObject remainShaftBack(JSONObject param);
/**
* 开始套轴
* @param param
* @return
*/
JSONObject startIntoTube(JSONObject param);
}

View File

@@ -16,6 +16,7 @@ import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.ext.mes.service.LmsToMesService;
import org.nl.wms.pda.mps.service.CasingService;
import org.nl.wms.sch.tasks.renovation.util.RenUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -143,12 +144,13 @@ public class CasingServiceImpl implements CasingService {
}
//如果一个分切组只有两个子卷,则一定得分两根轴进行绑定
if ("1".equals(order_type)) {
JSONArray group_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("parent_container_name = '" + parent_container_name + "' AND split_group = '" + split_group + "' AND is_delete = '0'").getResultJSONArray(0);
if (group_rows.size() == 2 && rows.size() == 2) {
throw new BadRequestException("该分切组只有两个分切计划,请选择两个不同的轴进行绑定!");
}
}
// remove不校验
// if ("1".equals(order_type)) {
// JSONArray group_rows = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("parent_container_name = '" + parent_container_name + "' AND split_group = '" + split_group + "' AND is_delete = '0'").getResultJSONArray(0);
// if (group_rows.size() == 2 && rows.size() == 2) {
// throw new BadRequestException("该分切组只有两个分切计划,请选择两个不同的轴进行绑定!");
// }
// }
for (int i = 0; i < rows.size(); i++) {

View File

@@ -151,7 +151,7 @@ public class OutServiceImpl implements OutService {
.addParam("flag", "3").process().uniqueResult(0);
// 套好纸管的空轴点位
Deliverycachepointivt dec = null;
List<PdmBiSlittingproductionplan> nextPlan = null;
List<PdmBiSlittingproductionplan> nextPlan;
if (isOpen) {
// 找下一趟
// 这里还需要多加一步判断,有没有下一趟分切计划,需要在缓存架找到对应的管芯。

View File

@@ -26,6 +26,7 @@ import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.mps.service.PaperTubeService;
import org.nl.wms.pdm.ivt.deliverycache.service.IDeliverycachepointivtService;
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliveryConDto;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.sch.tasks.CutConveyorTask;
import org.nl.wms.sch.tasks.CutTrussTask;
@@ -38,7 +39,6 @@ import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@@ -285,9 +285,11 @@ public class PaperTubeServiceImpl implements PaperTubeService {
Integer paperNum = (ObjectUtil.isNotEmpty(upLeftSizeK) && ObjectUtil.isNotEmpty(upRightSizeK)) ? 2 : 1;
List<PdmBiSlittingproductionplan> plans = new ArrayList<>();
// 虚拟计划
// 轴数量
for (int i = 0; i < number; i++) {
String parentContainer = area + "M虚拟" + i + TaskUtils.getDateTime("yyMMddHHmmss");
String now = DateUtil.now();
// 没根轴有多少管芯
for (int j = 0; j < paperNum; j++) {
PdmBiSlittingproductionplan plan = new PdmBiSlittingproductionplan();
plan.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextIdStr());
@@ -329,7 +331,7 @@ public class PaperTubeServiceImpl implements PaperTubeService {
plan.setQzz_generation(qzz_generation);
// 特殊数据
// 区分位置创建
if (ObjectUtil.isNotEmpty(upLeftSizeK)) {
if (ObjectUtil.isNotEmpty(upLeftSizeK) && j == 0) {
// 上左
plan.setPaper_tube_or_FRP(upLeftSizeV.startsWith("48") ? "1" : "2");
String[] split = upLeftSizeK.split("\\|");
@@ -346,7 +348,7 @@ public class PaperTubeServiceImpl implements PaperTubeService {
plan.setUp_or_down("1");
plan.setLeft_or_right("1");
}
if ( ObjectUtil.isNotEmpty(upRightSizeK)) {
if ( ObjectUtil.isNotEmpty(upRightSizeK) && j == 1) {
// 上右
plan.setPaper_tube_or_FRP(upRightSizeV.startsWith("48") ? "1" : "2");
String[] split = upRightSizeK.split("\\|");
@@ -496,7 +498,7 @@ public class PaperTubeServiceImpl implements PaperTubeService {
throw new BadRequestException("当前位置有未完成的任务!");
}
// 创建桁架任务,到内测输送线,新的任务类型
Deliverycachepointivt deliverCachePoint = deliverycachepointivtService.getOneByPointCode(pointCode, true);
Deliverycachepointivt deliverCachePoint = deliverycachepointivtService.getOneByPointCode(pointCode, true);
if (ObjectUtil.isNotEmpty(deliverCachePoint)) {
if (!deliverCachePoint.getPoint_status().equals("03")) {
throw new BadRequestException("该点位在系统中不是气胀轴!");
@@ -541,6 +543,126 @@ public class PaperTubeServiceImpl implements PaperTubeService {
return res;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject startIntoTube(JSONObject param) {
log.info("人工呼叫套轴: {}", param);
param.put("qqz_num", "1");
// 开始套轴,不走自动流程
// 参数param: area, device_code, up_left_size_k,up_right_size_k, up_left_size_v,up_right_size_v
// location, qzz_size, qzz_generation
String area = param.getString("area");
String location = param.getString("location");
String need_size = param.getString("qzz_size");
String need_generation = param.getString("qzz_generation");
// 判断空架子是否够,不够则不套轴
List<Deliverycachepointivt> cacheDeliverys = deliverycachepointivtService
.getDeliveryCacheByConditionsAndNoTask(DeliveryConDto.builder()
.location(location)
.area(area)
.pointStatus("01")
.qzzSize(need_size)
.sortSeq("1")
.build());
if (cacheDeliverys.size() == 0) {
throw new BadRequestException(area + "分切车间空轴架子不够!");
}
// 1、保存分切计划
log.info("正在保存虚拟分切计划....");
JSONObject planObj = doInsertPlan(param);
JSONArray plansArray = planObj.getJSONArray("plans");
List<PdmBiSlittingproductionplan> plans = plansArray.toJavaList(PdmBiSlittingproductionplan.class);
log.info("保存虚拟分切计划完成....");
// 2、呼叫空托盘
log.info("正在呼叫空托盘....");
doCallEmptyVehicle(area, location);
log.info("呼叫空托盘完成....");
// 3、呼叫气胀轴
log.info("正在呼叫气胀轴....");
doCallEmptyAirShaft(param, plans);
log.info("呼叫气胀轴完成....");
// 4、记录库存信息到套管工位
PdmBiSlittingproductionplan nextLeftPlan = plans.stream().filter(p -> "1".equals(p.getLeft_or_right())).findFirst().orElse(null);
PdmBiSlittingproductionplan nextRightPlan = plans.stream().filter(p -> "2".equals(p.getLeft_or_right())).findFirst().orElse(null);
// 获取套管工位
JSONObject tggw_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '4' AND product_area = '" + area + "'").uniqueResult(0);
tggw_jo.put("container_name1", ObjectUtil.isNotEmpty(nextLeftPlan) ? nextLeftPlan.getContainer_name() : "");
tggw_jo.put("container_name2", ObjectUtil.isNotEmpty(nextRightPlan) ? nextRightPlan.getContainer_name() : "");
tggw_jo.put("qzz_size", need_size);
tggw_jo.put("qzz_generation", need_generation);
tggw_jo.put("have_qzz", "1");
WQLObject.getWQLObject("st_ivt_shaftivt").update(tggw_jo);
JSONObject res = new JSONObject();
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "退回呼叫成功!");
return res;
}
/**
* 呼叫气胀轴
* @param param
*/
private void doCallEmptyAirShaft(JSONObject param, List<PdmBiSlittingproductionplan> plans) {
String product_area = param.getString("area");
String need_size = param.getString("qzz_size");
String need_generation = param.getString("qzz_generation");
// 获取左卷
PdmBiSlittingproductionplan nextLeftPlan = plans.stream().filter(p -> "1".equals(p.getLeft_or_right())).findFirst().orElse(null);
//判断当前穿拔轴机构上是否存在可用的气涨轴
JSONObject cbz_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '0' AND product_area = '" + product_area + "'").uniqueResult(0);
String have_qzz = cbz_jo.getString("have_qzz");
//判断当前RGV上是否存在未拔轴的成品卷
JSONObject rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '5' AND product_area = '" + product_area + "'").uniqueResult(0);
//判断是否存在未完成的成品下卷任务
JSONObject container_jo = WQLObject.getWQLObject("sch_base_task").query("task_type = '010605' AND product_area = '"+product_area+"' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if ("0".equals(have_qzz) && "0".equals(rgv_jo.getString("have_qzz")) && ObjectUtil.isEmpty(container_jo)) {
PaperTrussTask paperTrussTask = SpringContextHolder.getBean(PaperTrussTask.class);
// 创建桁架任务搬运一个符合的气涨轴
JSONObject jo = new JSONObject();
jo.put("task_type", "010602");
/*String public_area = "";
if (product_area.equals("A1") || product_area.equals("A2")) {
public_area = "A1";
}
if (product_area.equals("A3") || product_area.equals("A4")) {
public_area = "A3";
}*/
String flag = "2";
// 判断是不是3寸的
JSONObject qhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '6' AND product_area = '" + product_area + "'").uniqueResult(0);
jo.put("truss_type", "8");
jo.put("point_code1", qhd_jo.getString("point_code"));
jo.put("point_code2", cbz_jo.getString("point_code"));
jo.put("vehicle_code", nextLeftPlan.getContainer_name() + "-qzz");
jo.put("product_area", product_area);
JSONObject request_param = new JSONObject();
request_param.put("need_size", need_size);
request_param.put("need_generation", need_generation);
request_param.put("flag", flag);
jo.put("request_param", request_param.toString());
paperTrussTask.createTask(jo);
} else {
//如果穿拔轴上存在一根气胀轴且没有任务则下发ACS允许套轴
if ("1".equals(have_qzz)) {
String device_code = cbz_jo.getString("point_code");
//判断是否存在任务(当前穿拔轴机构上的,防止气胀轴会被拉走)
JSONObject paper_jo = WQLObject.getWQLObject("sch_base_task").query("point_code1 = '" + device_code + "' AND task_status < '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(paper_jo)) {
//给穿拔轴机下发套轴
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
JSONArray action_rows = new JSONArray();
JSONObject action_jo = new JSONObject();
action_jo.put("device_code", device_code);
action_jo.put("code", "to_command");
action_jo.put("product_area", product_area);
action_jo.put("value", "4");
action_rows.add(action_jo);
wmsToAcsService.action(action_rows);
}
}
}
}
public void doCreateTask(String area, String location, String qzz_generation, List<PdmBiSlittingproductionplan> plans) {
PdmBiSlittingproductionplan demoPlan = plans.get(0);
@@ -576,6 +698,20 @@ public class PaperTubeServiceImpl implements PaperTubeService {
}
public void doCallEmptyVehicle(String area, String location) {
int callEmptyNum = 1;
//减去对应已经在出库的空载具任务
JSONArray out_task = WQL.getWO("QAUTO_QUERY").addParam("flag", "2").addParam("point_location", location).addParam("product_area", area).process().getResultJSONArray(0);
callEmptyNum -= out_task.size();
//减去出口对应的载具
JSONObject out_jo = WQL.getWO("QAUTO_QUERY").addParam("flag", "3").addParam("point_location", location).addParam("product_area", area).process().uniqueResult(0);
if (ObjectUtil.isNotEmpty(out_jo)) {
callEmptyNum--;
}
if (callEmptyNum < 1) {
log.warn("无需呼叫托盘!");
return;
}
JSONObject empty_vehicle = WQL.getWO("PDA_02")
.addParam("sql_str", " ORDER BY point_code")
.addParam("product_area", area)
@@ -584,18 +720,14 @@ public class PaperTubeServiceImpl implements PaperTubeService {
// 创建输送线任务规则:(内测保持空载具、外侧先出的逻辑)
JSONObject form = new JSONObject();
if (ObjectUtil.isEmpty(empty_vehicle)) {
// todo: 如果还有需要空载具,但是此时这个区域已经没有位置了,创建半条任务,等待载具送达时候,触发。
if (RenUtils.isOpenTzArea(area)) {
JSONObject tips = new JSONObject();
tips.put("product_area", area);
tips.put("point_location", location);
form.put("point_code1", "");
form.put("vehicle_code2", "");
form.put("task_status", TaskStatusEnum.SURE_END.getCode());
form.put("tips", tips);
} else {
return ;
}
// 如果还有需要空载具,但是此时这个区域已经没有位置了,创建半条任务,等待载具送达时候,触发。
JSONObject tips = new JSONObject();
tips.put("product_area", area);
tips.put("point_location", location);
form.put("point_code1", "");
form.put("vehicle_code2", "");
form.put("task_status", TaskStatusEnum.SURE_END.getCode());
form.put("tips", tips);
} else {
form.put("point_code1", empty_vehicle.getString("point_code"));
form.put("vehicle_code2", empty_vehicle.getString("vehicle_code"));

View File

@@ -203,7 +203,6 @@
WHERE
point_status = '02'
AND ivt.is_used = '1'
AND ivt.point_type = '02'
AND NOT EXISTS (
SELECT
*
@@ -991,8 +990,8 @@
ivt.product_area = 输入.product_area
AND cut.point_location = 输入.point_location
AND plan.is_delete = '0'
AND ivt.point_type = '2'
AND have_qzz > 0 UNION
AND (ivt.point_type = '2' OR ivt.point_type = '11')
AND have_qzz = 1 UNION
SELECT
task.task_code AS start_code,
'2' AS type,

View File

@@ -1,6 +1,7 @@
package org.nl.wms.pdm.ivt.deliverycache.service.dao;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@@ -119,5 +120,7 @@ public class Deliverycachepointivt implements Serializable {
* 气胀轴代数
*/
private String qzz_generation;
@TableField(exist = false)
private String spec;
}

View File

@@ -1,9 +1,11 @@
package org.nl.wms.pdm.ivt.deliverycache.service.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliveryConDto;
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliverycachepointivtQuery;
import java.util.List;
@@ -20,4 +22,6 @@ public interface DeliverycachepointivtMapper extends BaseMapper<Deliverycachepoi
List<Deliverycachepointivt> getOneConformShaft(String gxCode, String area, String location);
List<Deliverycachepointivt> getMoreConformShaft(String gxCode1, String gcCode2, String area, String location);
IPage<Deliverycachepointivt> selectPageLeftJoin(IPage<Deliverycachepointivt> pages, DeliverycachepointivtQuery param);
}

View File

@@ -70,6 +70,7 @@
FROM pdm_bi_slittingproductionplan p
WHERE p.qzzno = de.qzzno
)
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.point_code1 = de.point_code AND t.task_status <![CDATA[ < ]]> '07' AND t.is_delete = '0')
AND 1 = (SELECT COUNT(*) FROM pdm_bi_slittingproductionplan pp WHERE pp.qzzno = de.qzzno)
</select>
<select id="getMoreConformShaft"
@@ -106,4 +107,30 @@
t.point_code1 = de.point_code OR t.point_code2 = de.point_code
)
</select>
<select id="selectPageLeftJoin"
resultType="org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt">
SELECT
d.*,
IF(LENGTH(p.FRP_description) > 0,p.FRP_description,p.paper_tube_description) AS spec
FROM
st_ivt_deliverycachepointivt d
LEFT JOIN pdm_bi_slittingproductionplan p ON p.qzzno = d.qzzno AND IFNULL(d.qzzno,'') <![CDATA[ <> ]]> ''
<where>
<if test="param.point_code != null">
d.point_code = #{param.point_code}
</if>
<if test="param.product_area != null">
AND d.product_area = #{param.product_area}
</if>
<if test="param.point_status != null">
AND d.point_status = #{param.point_status}
</if>
<if test="param.point_type != null">
AND d.point_type = #{param.point_type}
</if>
<if test="param.is_used != null">
AND d.is_used = #{param.is_used}
</if>
</where>
</select>
</mapper>

View File

@@ -36,15 +36,16 @@ public class DeliverycachepointivtServiceImpl extends ServiceImpl<Deliverycachep
private DeliverycachepointivtMapper deliverycachepointivtMapper;
@Override
public IPage<Deliverycachepointivt> queryAll(DeliverycachepointivtQuery whereJson, PageQuery page){
LambdaQueryWrapper<Deliverycachepointivt> lam = new LambdaQueryWrapper<>();
lam.like(ObjectUtil.isNotEmpty(whereJson.getPoint_code()), Deliverycachepointivt::getPoint_code, whereJson.getPoint_code())
.eq(ObjectUtil.isNotEmpty(whereJson.getProduct_area()), Deliverycachepointivt::getProduct_area, whereJson.getProduct_area())
.eq(ObjectUtil.isNotEmpty(whereJson.getPoint_status()), Deliverycachepointivt::getPoint_status, whereJson.getPoint_status())
.eq(ObjectUtil.isNotEmpty(whereJson.getPoint_type()), Deliverycachepointivt::getPoint_type, whereJson.getPoint_type())
.eq(ObjectUtil.isNotEmpty(whereJson.getIs_used()), Deliverycachepointivt::getIs_used, whereJson.getIs_used());
public IPage<Deliverycachepointivt> queryAll(DeliverycachepointivtQuery param, PageQuery page){
// LambdaQueryWrapper<Deliverycachepointivt> lam = new LambdaQueryWrapper<>();
// lam.like(ObjectUtil.isNotEmpty(whereJson.getPoint_code()), Deliverycachepointivt::getPoint_code, whereJson.getPoint_code())
// .eq(ObjectUtil.isNotEmpty(whereJson.getProduct_area()), Deliverycachepointivt::getProduct_area, whereJson.getProduct_area())
// .eq(ObjectUtil.isNotEmpty(whereJson.getPoint_status()), Deliverycachepointivt::getPoint_status, whereJson.getPoint_status())
// .eq(ObjectUtil.isNotEmpty(whereJson.getPoint_type()), Deliverycachepointivt::getPoint_type, whereJson.getPoint_type())
// .eq(ObjectUtil.isNotEmpty(whereJson.getIs_used()), Deliverycachepointivt::getIs_used, whereJson.getIs_used());
IPage<Deliverycachepointivt> pages = new Page<>(page.getPage() + 1, page.getSize());
deliverycachepointivtMapper.selectPage(pages, lam);
// deliverycachepointivtMapper.selectPage(pages, lam);
pages = deliverycachepointivtMapper.selectPageLeftJoin(pages, param);
return pages;
}

View File

@@ -6,9 +6,14 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.nl.b_lms.sch.point.dao.StIvtShaftivt;
import org.nl.b_lms.sch.point.service.IstIvtShaftivtService;
import org.nl.b_lms.sch.task.dao.SchBaseTask;
import org.nl.b_lms.sch.task.service.IschBaseTaskService;
import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject;
@@ -17,6 +22,9 @@ import org.nl.system.service.param.ISysParamService;
import org.nl.system.service.param.dao.Param;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.mps.service.CasingService;
import org.nl.wms.pdm.ivt.deliverycache.service.IDeliverycachepointivtService;
import org.nl.wms.pdm.ivt.deliverycache.service.dao.Deliverycachepointivt;
import org.nl.wms.pdm.ivt.deliverycache.service.dto.DeliveryConDto;
import org.nl.wms.sch.tasks.CutConveyorTask;
import org.nl.wms.sch.tasks.PaperTrussTask;
import org.nl.wms.sch.tasks.PaperTubeTask;
@@ -24,9 +32,11 @@ import org.nl.wms.sch.tasks.URLEnum;
import org.nl.wms.sch.tasks.renovation.util.RenUtils;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static org.nl.wms.sch.tasks.renovation.util.RenUtils.isOpenTzArea;
@@ -49,6 +59,9 @@ public class AutoCallEmptyVehicle {
private final RedissonClient redissonClient;
private final ISysParamService paramService;
private final IschBaseTaskService taskService;
private final IstIvtShaftivtService shaftivtService;
private final IDeliverycachepointivtService deliverycachepointivtService;
public final static String TZ_DAY = "TZ_DAY_ONE";
@@ -89,6 +102,7 @@ public class AutoCallEmptyVehicle {
}
void callEmptyVehicle(String product_area, String point_location, String dayNum) {
log.info("区域:{}, 位置:{}", product_area, point_location);
//下半部分的分切组
JSONArray down_rows = WQL.getWO("QAUTO_QUERY")
.addParam("flag", "1")
@@ -99,7 +113,6 @@ public class AutoCallEmptyVehicle {
// todo: 空载具只有按需呼叫不在自动创建到out点
//下半部分需要的总空载具
int donw_num = 0;
for (int i = 0; i < down_rows.size(); i++) {
JSONObject row = down_rows.getJSONObject(i);
String parent_container_name = row.getString("parent_container_name");
@@ -110,13 +123,44 @@ public class AutoCallEmptyVehicle {
"AND split_group = '" + split_group + "' AND is_delete = '0' AND is_call = '1' AND IFNULL(is_paper_ok,'0') = '0' order by container_name").getResultJSONArray(0);
// 下发ACS任务呼叫纸管
this.callPaperTube(plan_rows, product_area);
// this.callPaperTube(plan_rows, product_area);
// hint: 如果是两个分切计划以上,必定是两根轴
if (plan_rows.size() >= 2) {
donw_num += 2;
} else if (plan_rows.size() == 1) {
donw_num += 1;
}
if (plan_rows.size() > 0) {
JSONObject plan = plan_rows.getJSONObject(0);
// 判断是否有气胀轴,没有气胀轴就跳过
List<StIvtShaftivt> allQzzPoints = shaftivtService.getCanUsePoint(plan.getString("qzz_size"), plan.getString("qzz_generation"), product_area);
// 获取取货点任务
int qhd = taskService.count(new LambdaQueryWrapper<SchBaseTask>()
.eq(SchBaseTask::getIs_delete, "0")
.eq(SchBaseTask::getProduct_area, product_area)
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.like(SchBaseTask::getPoint_code1, "QHD"));
log.info("需要的轴数:{}个,气胀轴还有:{}个,取货点任务有:{}个", donw_num, allQzzPoints.size(), qhd);
if (donw_num > allQzzPoints.size()) {
log.warn("气胀轴不够用,该计划不套轴!!!");
continue;
}
// 判断空架子是否够,不够则不套轴
List<Deliverycachepointivt> cacheDeliverys = deliverycachepointivtService
.getDeliveryCacheByConditionsAndNoTask(DeliveryConDto.builder()
.location(point_location)
.area(product_area)
.pointStatus("01")
.qzzSize(plan.getString("qzz_size"))
.sortSeq("1")
.build());
if (cacheDeliverys.size() == 0) {
log.info(product_area + "分切车间空轴架子不够!");
break;
}
}
// 下发ACS任务呼叫纸管
this.callPaperTube(plan_rows, product_area);
}
/* ******************* 校验需要呼叫的载具数 ******************* */
// 断点:"A1".equals(product_area) && "1".equals(point_location)
@@ -137,8 +181,8 @@ public class AutoCallEmptyVehicle {
}
//减去入库任务数量
JSONArray in_task = WQL.getWO("QAUTO_QUERY").addParam("flag", "5").addParam("point_location", point_location).addParam("product_area", product_area).process().getResultJSONArray(0);
donw_num -= in_task.size();
// JSONArray in_task = WQL.getWO("QAUTO_QUERY").addParam("flag", "5").addParam("point_location", point_location).addParam("product_area", product_area).process().getResultJSONArray(0);
// donw_num -= in_task.size();
log.info("此时需要呼叫托盘的数量:{}", donw_num);
//如果需要空载具数量大于0进行呼叫载具
@@ -146,7 +190,7 @@ public class AutoCallEmptyVehicle {
for (int i = 0; i < donw_num; i++) {
// 这里最多就6个位置
JSONObject empty_vehicle = WQL.getWO("PDA_02")
.addParam("sql_str", " ORDER BY point_code")
.addParam("sql_str", " ORDER BY point_type, point_code")
.addParam("product_area", product_area)
.addParam("point_location", point_location)
.addParam("flag", "302").process().uniqueResult(0);
@@ -154,7 +198,7 @@ public class AutoCallEmptyVehicle {
// 创建输送线任务规则:(内测保持空载具、外侧先出的逻辑)
JSONObject form = new JSONObject();
if (ObjectUtil.isEmpty(empty_vehicle)) {
// todo: 如果还有需要空载具,但是此时这个区域已经没有位置了,创建半条任务,等待载具送达时候(横移完毕),触发。
// todo: 如果还有需要空载具,但是此时这个区域已经没有位置了,创建半条任务,等待载具送达时候(桁架任务完毕),触发。
if (RenUtils.isOpenTzArea(product_area)) {
JSONObject tips = new JSONObject();
tips.put("product_area", product_area);
@@ -460,27 +504,12 @@ public class AutoCallEmptyVehicle {
JSONObject jo = new JSONObject();
jo.put("task_type", "010606");
// jo.put("truss_type", "8");
jo.put("truss_type", "8");
jo.put("task_status", TaskStatusEnum.SURE_START.getCode());
// 气胀轴-取货点point_type=6
JSONObject qhd_jo;
String flag = "1";
// 判断是不是3寸的
if ("3".equals(need_size) && RenUtils.isOpenTempArea(product_area) && RenUtils.isOpenTzArea(product_area)) {
//查询可用的空点位
qhd_jo = WQL.getWO("QAUTO_QUERY").addParam("flag", "6002")
.addParam("need_size", need_size)
.addParam("need_generation", need_generation)
.addParam("product_area", product_area)
.process().uniqueResult(0);
jo.put("truss_type", "1");
flag = "1";
} else {
qhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '6' AND product_area = '" + product_area + "'").uniqueResult(0);
jo.put("truss_type", "8");
flag = "2";
}
// JSONObject qhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '6' AND product_area = '" + product_area + "'").uniqueResult(0);
String flag = "2";
// remove判断是不是3寸的, (去掉没有等待点的任务)
JSONObject qhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '6' AND product_area = '" + product_area + "'").uniqueResult(0);
jo.put("point_code1", qhd_jo.getString("point_code"));
// todo: 如果in点没空载具呢 再此已经呼叫过空载具,如果载具回流,需要在某处进行判断
JSONObject in_jo = WQLObject.getWQLObject("sch_base_point").query("product_area = '" + product_area + "' AND point_type = '6'").uniqueResult(0);

View File

@@ -34,7 +34,7 @@ public class AutoSendOutShaft {
public void run() {
List<StIvtShaftivt> list = shaftivtService.list(new LambdaQueryWrapper<StIvtShaftivt>()
.eq(StIvtShaftivt::getPoint_type, "11")
.eq(StIvtShaftivt::getHave_qzz, "1")
.eq(StIvtShaftivt::getHave_qzz, "2")
.eq(StIvtShaftivt::getIs_used, "1"));
for (StIvtShaftivt stIvtShaftivt : list) {
JSONObject rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '5' AND product_area = '" + stIvtShaftivt.getProduct_area() + "'").uniqueResult(0);

View File

@@ -169,6 +169,7 @@ public class CutConveyorTask extends AbstractAcsTask {
String point_code2 = jsonTask.getString("point_code2");
//分切输送出任务(到内包间)
IstIvtShaftivtService shaftivtService = SpringContextHolder.getBean(IstIvtShaftivtService.class);
if ("010401".equals(jsonTask.getString("task_type"))) {
// 校验终点是否存在
JSONObject jsonIvt = ivtTab.query("point_code ='" + point_code1 + "'").uniqueResult(0);
@@ -232,16 +233,16 @@ public class CutConveyorTask extends AbstractAcsTask {
jo.put("truss_type", "6");
if (RenUtils.isOpenTzArea(out_jo.getString("product_area"))) {
// hint: 超过1400 或者 饵料 需要送到新增的人工处理RGV上。
JSONObject rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '10' AND product_area = '" + jsonTask.getString("product_area") + "'").uniqueResult(0);
JSONObject rg_rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '10' AND product_area = '" + jsonTask.getString("product_area") + "'").uniqueResult(0);
if (out_jo.getString("vehicle_code").contains("废箔")) {
jo.put("point_code2", rgv_jo.getString("point_code"));
jo.put("point_code2", rg_rgv_jo.getString("point_code"));
} else {
List<String> list = JSON.parseArray(jsonTask.getString("request_param"), String.class);
List<PdmBiSlittingproductionplan> plans = planService.getByContainerNames(list);
PdmBiSlittingproductionplan demoPlan = plans.get(0);
Integer paperLength = Integer.valueOf(SlitterTaskUtil.getPaperLength(demoPlan));
if (paperLength >= 1400) {
jo.put("point_code2", rgv_jo.getString("point_code"));
jo.put("point_code2", rg_rgv_jo.getString("point_code"));
}
}
jo.put("truss_type", "1");
@@ -262,12 +263,11 @@ public class CutConveyorTask extends AbstractAcsTask {
.eq(SchBaseTask::getPoint_code2, rgv_jo.getString("point_code"))
.lt(SchBaseTask::getTask_status, TaskStatusEnum.FINISHED.getCode())
.eq(SchBaseTask::getIs_delete, "0"));
canUse = qty > taskNum;
canUse = qty >= taskNum;
}
if (!rgvResStatus.equals("200") || !canUse) {
log.warn("RGV不可用或者不够用送到暂存架{}", canUseRgv.getString("message"));
// hint: 创建到子卷暂存架
IstIvtShaftivtService shaftivtService = SpringContextHolder.getBean(IstIvtShaftivtService.class);
List<StIvtShaftivt> caches = shaftivtService.getCachePointNoTask(rgv_jo.getString("product_area"));
if (caches.size() > 0) {
StIvtShaftivt shaftivt = caches.get(0);
@@ -286,10 +286,45 @@ public class CutConveyorTask extends AbstractAcsTask {
paperTrussTask.createTask(pa);
return;
}
} else {
jo.put("point_code2", rgv_jo.getString("point_code"));
jo.put("truss_type", "6");
}
if (ObjectUtil.isEmpty(jo.getString("point_code2"))) {
// 如果没找到或者暂存也没位置那就去人工RGV
JSONObject rg_rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '10' AND product_area = '" + jsonTask.getString("product_area") + "'").uniqueResult(0);
jo.put("point_code2", rg_rgv_jo.getString("point_code"));
jo.put("truss_type", "1");
}
}
// 如果是人工RGV就呼叫RGV进来。
// 通知RGV进去
if (jo.getString("point_code2").contains("RG_RGV")) {
// 校验人工RGV是否空闲。
JSONArray device_rows = new JSONArray();
JSONObject device_obj = new JSONObject();
device_rows.add(device_obj);
device_obj.put("device_code", jo.getString("point_code2"));
device_obj.put("product_area", jsonTask.getString("product_area"));
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
throw new BadRequestException("获取人工RGV信息失败");
}
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
if (data2.getString("move2").equals("1")) {
throw new BadRequestException("人工RGV有货需要尽快处理");
}
JSONArray action_rows = new JSONArray();
JSONObject action_jo = new JSONObject();
action_jo.put("device_code", jo.getString("point_code2"));
action_jo.put("code", "to_command");
action_jo.put("product_area", jsonTask.getString("product_area"));
action_jo.put("value", "1");
action_rows.add(action_jo);
JSONObject action = wmsToAcsService.action(action_rows);
if (!action.getString("status").equals("200")) {
throw new BadRequestException("该区域人工RGV异常");
}
// 如果没找到或者暂存也没位置,那就卡在桁架任务上
jo.put("point_code2", rgv_jo.getString("point_code"));
jo.put("truss_type", "6");
}
jo.put("vehicle_code", jsonTask.getString("vehicle_code"));
jo.put("product_area", jsonTask.getString("product_area"));
@@ -460,6 +495,7 @@ public class CutConveyorTask extends AbstractAcsTask {
} else {
// vehicle_code2托盘码
if (StrUtil.isNotEmpty(jsonTask.getString("vehicle_code2"))) {
// 改造业务
if (RenUtils.isOpenTzArea(jsonTask.getString("product_area"))) {
IDeliverycachepointivtService deliverycachepointivtService = SpringContextHolder.getBean(IDeliverycachepointivtService.class);
// 判断中转架是否存在需要到内包间的任务
@@ -515,26 +551,28 @@ public class CutConveyorTask extends AbstractAcsTask {
jo.put("task_type", "010603");
jo.put("point_code1", jsonTask.getString("point_code2"));
if ("1".equals(flag)) {
// remove: 判断是不是3寸的(已去除)
// 空轴
JSONObject fhd_jo;
// 判断是不是3寸的
if (RenUtils.isOpenTzArea(product_area) && "3".equals(qzzSize) && RenUtils.isOpenTempArea(product_area)) {
//查询可用的空点位
fhd_jo = WQL.getWO("QAUTO_QUERY").addParam("flag", "6001")
.addParam("need_size", qzzSize)
.addParam("need_generation", qzzGeneration)
.addParam("product_area", product_area)
.process().uniqueResult(0);
jo.put("truss_type", "1");
} else {
// A1_FHD_01
fhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '7' AND product_area = '" + product_area + "'").uniqueResult(0);
jo.put("truss_type", "8");
}
JSONObject fhd_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '7' AND product_area = '" + product_area + "'").uniqueResult(0);
jo.put("truss_type", "8");
jo.put("point_code2", fhd_jo.getString("point_code"));
} else {
// hint: 管轴 需要送到新增的人工处理RGV上。
JSONObject rgv_jo = WQLObject.getWQLObject("st_ivt_shaftivt").query("point_type = '10' AND product_area = '" + jsonTask.getString("product_area") + "'").uniqueResult(0);
// 校验人工RGV是否空闲。
JSONArray device_rows = new JSONArray();
JSONObject device_obj = new JSONObject();
device_rows.add(device_obj);
device_obj.put("device_code", rgv_jo.getString("point_code"));
device_obj.put("product_area", product_area);
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
throw new BadRequestException("获取人工RGV信息失败");
}
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
if (data2.getString("move2").equals("1")) {
throw new BadRequestException("人工RGV有货需要尽快处理");
}
jo.put("point_code2", rgv_jo.getString("point_code"));
jo.put("truss_type", "1");
}

View File

@@ -536,7 +536,7 @@ public class CutTrussTask extends AbstractAcsTask {
String point_location = jsonIvt.getString("point_location");
String product_area = jsonIvt.getString("product_area");
// 先判断是否需要送回内包间
// 先判断是否需要送回内包间(获取半条任务)
List<SchBaseTask> needVehicleTasks = taskService.getAllTaskByTypeAndStatus("010401", "03");
SchBaseTask needTask = null;
for (SchBaseTask needVehicleTask : needVehicleTasks) {

View File

@@ -150,13 +150,22 @@ public class PaperTrussTask extends AbstractAcsTask {
int have_qzz = rgv_jo.getIntValue("have_qzz");
rgv_jo.put("have_qzz", have_qzz + 1);
ivt_shaftivt.update(rgv_jo);
// 判断是不是暂存架,需要清除库存
if (task_jo.getString("point_code1").contains("CPZC")) {
// 清空
JSONObject cpzc_jo = ivt_shaftivt.query("point_code = '" + task_jo.getString("point_code1") + "'").uniqueResult(0);
cpzc_jo.put("qzz_size", "");
cpzc_jo.put("qzz_generation", "");
cpzc_jo.put("have_qzz", "0");
ivt_shaftivt.update(cpzc_jo);
}
}
//套轴气胀轴放货任务
if ("010606".equals(task_type)) {
String point_code = task_jo.getString("point_code1");
JSONObject goal_point = ivt_shaftivt.query("point_code = '" + point_code + "'").uniqueResult(0);
JSONObject request_param_jo = task_jo.getJSONObject("request_param");
if ("2".equals(goal_point.getString("point_type"))) {
if ("2".equals(goal_point.getString("point_type")) || "11".equals(goal_point.getString("point_type"))) {
goal_point.put("qzz_size", "");
goal_point.put("qzz_generation", "");
goal_point.put("have_qzz", "0");
@@ -218,7 +227,8 @@ public class PaperTrussTask extends AbstractAcsTask {
JSONObject requestParam = taskObj.getJSONObject("request_param");
IstIvtShaftivtService shaftivtService = SpringContextHolder.getBean(IstIvtShaftivtService.class);
StIvtShaftivt one = shaftivtService.getOne(new LambdaQueryWrapper<StIvtShaftivt>().eq(StIvtShaftivt::getPoint_code, pointCode2));
one.setHave_qzz("1");
// 设置2是为了标记这里是成品卷不是套好的轴
one.setHave_qzz("2");
one.setQzz_generation(requestParam.getString("have_generation"));
one.setContainer_name1(taskObj.getString("vehicle_code"));
shaftivtService.updateById(one);

View File

@@ -53,7 +53,7 @@
pdm_bi_slittingproductionplan plan
LEFT JOIN st_ivt_cutpointivt cut ON cut.ext_code = plan.resource_name
WHERE
`status` < '05'
`status` = '01'
AND is_call = '1'
AND order_type = '1'
AND IFNULL( call_time, '' ) <> ''

View File

@@ -186,6 +186,7 @@
</template>
</el-table-column>
<el-table-column prop="qzzno" label="气涨轴" :min-width="flexWidth('qzzno',crud.data,'气涨轴')" />
<el-table-column prop="spec" label="规格" :min-width="flexWidth('spec',crud.data,'气涨轴')" />
<el-table-column prop="point_status" label="点位状态">
<template slot-scope="scope">
{{ dict.label.delivery_point_status[scope.row.point_status] }}