fix: 呼叫气胀轴查询acs,气胀轴库没货则生成任务
This commit is contained in:
@@ -23,7 +23,9 @@ public interface BstIvtShafttubeivtMapper extends BaseMapper<BstIvtShafttubeivt>
|
|||||||
* @param location 位置(上下)
|
* @param location 位置(上下)
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<BstIvtShafttubeivt> getNotTaskShaftCache(String qzzSize, String specification, String location);
|
List<BstIvtShafttubeivt> getNotTaskShaftCache(@Param("qzzSize") String qzzSize,
|
||||||
|
@Param("specification") String specification,
|
||||||
|
@Param("location") String location);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取空气胀轴的气胀轴暂存位
|
* 获取空气胀轴的气胀轴暂存位
|
||||||
|
|||||||
@@ -29,7 +29,9 @@
|
|||||||
WHERE b.have_qzz = '1'
|
WHERE b.have_qzz = '1'
|
||||||
AND b.point_type = '6'
|
AND b.point_type = '6'
|
||||||
AND b.qzz_size = #{qzzSize}
|
AND b.qzz_size = #{qzzSize}
|
||||||
|
<if test="qzzSize != 6">
|
||||||
AND b.qzz_generation = #{specification}
|
AND b.qzz_generation = #{specification}
|
||||||
|
</if>
|
||||||
AND b.point_location = #{location}
|
AND b.point_location = #{location}
|
||||||
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[ < ]]> '07' AND t.point_code1 = b.point_code)
|
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[ < ]]> '07' AND t.point_code1 = b.point_code)
|
||||||
ORDER BY b.sort_seq DESC
|
ORDER BY b.sort_seq DESC
|
||||||
|
|||||||
@@ -301,7 +301,16 @@ public class AutoCallAirShaftTask {
|
|||||||
throw new BadRequestException("气胀轴库找不到[" + qzzSize + "]规格的气涨轴");
|
throw new BadRequestException("气胀轴库找不到[" + qzzSize + "]规格的气涨轴");
|
||||||
}
|
}
|
||||||
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||||
// todo: 访问acs判断有无气涨轴
|
// 访问acs判断有无气涨轴
|
||||||
|
JSONArray array = new JSONArray();
|
||||||
|
JSONObject device = new JSONObject();
|
||||||
|
device.put("device_code", shafttubeivt.getPoint_code());
|
||||||
|
array.add(device);
|
||||||
|
JSONObject pointStatus = wmsToAcsService.getPointStatus(array);
|
||||||
|
if (pointStatus.getInteger("qty") == 0) {
|
||||||
|
// 没有货
|
||||||
|
toCreatShaftCacheTask(qzzSize, location, empty);
|
||||||
|
} else {
|
||||||
JSONArray acsParam = new JSONArray();
|
JSONArray acsParam = new JSONArray();
|
||||||
JSONObject acsQzz = new JSONObject();
|
JSONObject acsQzz = new JSONObject();
|
||||||
acsQzz.put("device_code", shafttubeivt.getPoint_code());
|
acsQzz.put("device_code", shafttubeivt.getPoint_code());
|
||||||
@@ -311,20 +320,18 @@ public class AutoCallAirShaftTask {
|
|||||||
acsParam.add(acsQzz);
|
acsParam.add(acsQzz);
|
||||||
wmsToAcsService.action(acsParam);
|
wmsToAcsService.action(acsParam);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* todo: 预留
|
|
||||||
* 创建气涨轴缓存的桁架任务
|
* 创建气涨轴缓存的桁架任务
|
||||||
*
|
*
|
||||||
* @param qzzSize 气涨轴尺寸
|
* @param qzzSize 气涨轴尺寸
|
||||||
* @param specification 标箔、锂电(1,2)
|
|
||||||
* @param location 位置:上半部分还是下半部分
|
* @param location 位置:上半部分还是下半部分
|
||||||
* @param empty 套拔轴点位
|
* @param empty 套拔轴点位
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
private void toCreatShaftCacheTask(String qzzSize, String location, BstIvtShafttubeivt empty) {
|
||||||
private void toCreatShaftCacheTask(String qzzSize, String specification, String location, BstIvtShafttubeivt empty) {
|
|
||||||
// 获取气涨轴缓存没有任务的点位
|
// 获取气涨轴缓存没有任务的点位
|
||||||
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getNotTaskShaftCache(qzzSize, specification, location);
|
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getNotTaskShaftCache(qzzSize, empty.getQzz_generation(), location);
|
||||||
if (shafttubeivts.size() == 0) {
|
if (shafttubeivts.size() == 0) {
|
||||||
throw new BadRequestException("未找到气涨轴规格「" + qzzSize + "」的暂存位");
|
throw new BadRequestException("未找到气涨轴规格「" + qzzSize + "」的暂存位");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,13 @@ public interface SlitterService {
|
|||||||
*/
|
*/
|
||||||
JSONObject acsSendShaftToCache(JSONObject param);
|
JSONObject acsSendShaftToCache(JSONObject param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ACS申请从气涨轴暂存位呼叫气胀轴
|
||||||
|
* @param param /
|
||||||
|
* @return /
|
||||||
|
*/
|
||||||
|
JSONObject acsCallShaftFromCache(JSONObject param);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分切机下料
|
* 分切机下料
|
||||||
* @param param
|
* @param param
|
||||||
|
|||||||
@@ -399,6 +399,40 @@ public class SlitterServiceImpl implements SlitterService {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject acsCallShaftFromCache(JSONObject param) {
|
||||||
|
log.info("ACS申请从气涨轴暂存位呼叫气胀轴的输入参数为:{}", param);
|
||||||
|
JSONObject res = new JSONObject();
|
||||||
|
String deviceCode = param.getString("device_code");
|
||||||
|
String qzzSize = param.getString("size");
|
||||||
|
// 判断是否有未完成的任务
|
||||||
|
List<SchBaseTask> list = taskService.list(new LambdaQueryWrapper<SchBaseTask>()
|
||||||
|
.eq(SchBaseTask::getPoint_code1, deviceCode)
|
||||||
|
.lt(SchBaseTask::getTask_status, "07"));
|
||||||
|
if (list.size() > 0) {
|
||||||
|
throw new BadRequestException("点位[" + deviceCode + "]存在未完成得任务!");
|
||||||
|
}
|
||||||
|
BstIvtShafttubeivt startPoint = shafttubeivtService.getByPointCode(deviceCode, false);
|
||||||
|
// 获取气涨轴缓存没有任务的点位
|
||||||
|
List<BstIvtShafttubeivt> shafttubeivts = shafttubeivtService.getNotTaskShaftCache(qzzSize,
|
||||||
|
startPoint.getQzz_generation(), startPoint.getPoint_location());
|
||||||
|
if (shafttubeivts.size() == 0) {
|
||||||
|
throw new BadRequestException("未找到气涨轴规格「" + qzzSize + "」的暂存位");
|
||||||
|
}
|
||||||
|
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
|
||||||
|
JSONObject taskParam = new JSONObject();
|
||||||
|
taskParam.put("point_code1", shafttubeivt.getPoint_code());
|
||||||
|
taskParam.put("point_code2", startPoint.getPoint_code());
|
||||||
|
taskParam.put("is_bushing", SlitterConstant.SLITTER_YES);
|
||||||
|
taskParam.put("task_type", SlitterEnum.TASK_TYPE.code("穿拔轴位<>气胀轴缓存位"));
|
||||||
|
taskParam.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
|
||||||
|
taskParam.put("qzz_size", qzzSize);
|
||||||
|
trussCallShaftCacheTask.createTask(taskParam);
|
||||||
|
res.put("status", HttpStatus.HTTP_OK);
|
||||||
|
res.put("message", "请求成功");
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
@SneakyThrows
|
@SneakyThrows
|
||||||
@Override
|
@Override
|
||||||
// @Transactional(rollbackFor = Exception.class)
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.junit.jupiter.api.DisplayName;
|
import org.junit.jupiter.api.DisplayName;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.extension.ExtendWith;
|
import org.junit.jupiter.api.extension.ExtendWith;
|
||||||
|
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.BstIvtShafttubeivt;
|
||||||
|
import org.nl.b_lms.bst.ivt.shafttubeivt.service.dao.mapper.BstIvtShafttubeivtMapper;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation;
|
||||||
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
import org.nl.b_lms.pdm.subpackagerelation.dao.mapper.PdmBiSubpackagerelationMapper;
|
||||||
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
|
||||||
@@ -19,6 +21,7 @@ import org.nl.common.enums.ContainerLevelEnum;
|
|||||||
import org.nl.common.enums.PackageInfoIvtEnum;
|
import org.nl.common.enums.PackageInfoIvtEnum;
|
||||||
import org.nl.modules.common.exception.BadRequestException;
|
import org.nl.modules.common.exception.BadRequestException;
|
||||||
import org.nl.system.service.param.ISysParamService;
|
import org.nl.system.service.param.ISysParamService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||||
|
|
||||||
@@ -29,8 +32,8 @@ import java.util.stream.Stream;
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@ExtendWith(SpringExtension.class)
|
@ExtendWith(SpringExtension.class)
|
||||||
@SpringBootTest
|
|
||||||
@DisplayName("event test")
|
@DisplayName("event test")
|
||||||
|
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||||
public class EventTest {
|
public class EventTest {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
@@ -57,6 +60,14 @@ public class EventTest {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private PdmBiSubpackagerelationMapper pdmBiSubpackagerelationMapper;
|
private PdmBiSubpackagerelationMapper pdmBiSubpackagerelationMapper;
|
||||||
|
@Autowired
|
||||||
|
private BstIvtShafttubeivtMapper bstIvtShafttubeivtMapper;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void sl() {
|
||||||
|
List<BstIvtShafttubeivt> notTaskShaftCache = bstIvtShafttubeivtMapper.getNotTaskShaftCache("3", "4", "0");
|
||||||
|
System.out.println(notTaskShaftCache);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 装箱区->空载具缓存位补空
|
* 装箱区->空载具缓存位补空
|
||||||
|
|||||||
Reference in New Issue
Block a user