Browse Source

opt:修改穿拔轴设备不通用的逻辑

master
张东升 2 days ago
parent
commit
46af237886
  1. 5
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/IBstIvtCutpointivtService.java
  2. 4
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/dao/mapper/BstIvtCutpointivtMapper.java
  3. 20
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/dao/mapper/BstIvtCutpointivtMapper.xml
  4. 2
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/dto/CutpointAirShhaftDto.java
  5. 8
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/impl/BstIvtCutpointivtServiceImpl.java
  6. 14
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/IBstIvtShafttubeivtService.java
  7. 4
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/dao/BstIvtShafttubeivt.java
  8. 10
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/dao/mapper/BstIvtShafttubeivtMapper.java
  9. 14
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/dao/mapper/BstIvtShafttubeivtMapper.xml
  10. 16
      lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/impl/BstIvtShafttubeivtServiceImpl.java
  11. 43
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/TrussCallAirShaftTask.java
  12. 310
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/auto/AutoCallAirShaftTask.java
  13. 18
      lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/service/impl/SlitterServiceImpl.java
  14. 2
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java

5
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/IBstIvtCutpointivtService.java

@ -94,7 +94,8 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
* @return
*/
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String location);
List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String product_area);
/**
* 获取一半的点位
@ -135,7 +136,7 @@ public interface IBstIvtCutpointivtService extends IService<BstIvtCutpointivt> {
*/
List<BstIvtCutpointivt> getPintByAgvCodesByPointTypeAndArea(String area, List<String> types);
List<BstIvtCutpointivt> getNBJCanUsePoint(String type, String pointStatus, String area, String sort);
List<BstIvtCutpointivt> getNBJCanUsePoint(String type, String pointStatus, String product_area, String sort);
List<BstIvtCutpointivt> getNBJAreaNotTaskPointByStatus(String type, String pointStatus, String area, String sort);
}

4
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/dao/mapper/BstIvtCutpointivtMapper.java

@ -19,7 +19,7 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
List<BstIvtCutpointivt> getAreaNotTaskPointByLocationAreaAndStatus(String location);
List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String location);
List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String product_area);
List<BstIvtCutpointivt> getAllHalfPlacePoints(String type, String pointStatus, String location);
@ -29,7 +29,7 @@ public interface BstIvtCutpointivtMapper extends BaseMapper<BstIvtCutpointivt> {
List<BstIvtCutpointivt> getAreaNotTaskPointByStatusNotCheckPickUpCompleted(String type, String pointStatus, String area, String sort);
List<BstIvtCutpointivt> getNBJCanUsePoint(String type, String pointStatus, String area, String sort);
List<BstIvtCutpointivt> getNBJCanUsePoint(String type, String pointStatus, String product_area, String sort);
List<BstIvtCutpointivt> getNBJAreaNotTaskPointByStatus(String type, String pointStatus, String area, String sort);
}

20
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/dao/mapper/BstIvtCutpointivtMapper.xml

@ -164,7 +164,7 @@
WHERE bic.point_type = #{type}
AND bic.is_used = '1'
AND bic.point_status = #{pointStatus}
AND bic.point_location = #{area}
AND bic.product_area = #{product_area}
AND 0 = (SELECT COUNT(*)
FROM sch_base_task t
WHERE t.task_status <![CDATA[ < ]]> '07'
@ -211,7 +211,13 @@
</select>
<select id="getAreaNotTaskPointByTcQzzPoint"
resultType="org.nl.b_lms.bst.ivt.cutpointivt.service.dto.CutpointAirShhaftDto">
SELECT bic.ivt_id,bic.point_code,bic.qzz_no1 as qzz_no,bic.truss_point_code1 as qzz_point, p.qzz_generation, p.qzz_size
SELECT bic.ivt_id,
bic.point_code,
bic.qzz_no1 as qzz_no,
bic.truss_point_code1 as qzz_point,
p.qzz_generation,
bic.product_area,
p.qzz_size
FROM bst_ivt_cutpointivt bic
LEFT JOIN pdm_bi_slittingproductionplan p ON ((p.qzzno = bic.qzz_no1 AND IFNULL(bic.qzz_no1,'') != '')
OR (p.qzzno = bic.qzz_no2 AND IFNULL(bic.qzz_no2,'') != ''))
@ -219,20 +225,24 @@
AND bic.is_used = '1'
AND bic.point_status = '3'
AND qzz_no1 !=''
AND bic.point_location = #{area}
AND 0 = (SELECT COUNT(*)
FROM sch_base_task t
WHERE t.task_status <![CDATA[ <= ]]> '071' AND t.task_status <![CDATA[ <> ]]> '07'
AND t.is_delete = '0'
AND (t.point_code1 = bic.truss_point_code1 oR t.point_code2 = bic.truss_point_code1))
UNION all
SELECT bic.ivt_id,bic.point_code,bic.qzz_no2 as qzz_no,bic.truss_point_code2 as qzz_point, p.qzz_generation, p.qzz_size
SELECT bic.ivt_id,
bic.point_code,
bic.qzz_no2 as qzz_no,
bic.truss_point_code2 as qzz_point,
p.qzz_generation,
bic.product_area,
p.qzz_size
FROM bst_ivt_cutpointivt bic
LEFT JOIN pdm_bi_slittingproductionplan p ON ((p.qzzno = bic.qzz_no1 AND IFNULL(bic.qzz_no1,'') != '')
OR (p.qzzno = bic.qzz_no2 AND IFNULL(bic.qzz_no2,'') != ''))
WHERE bic.point_type = '1'
AND bic.is_used = '1'
AND bic.point_location = #{area}
AND bic.point_status = '3'
AND qzz_no2 !=''
AND 0 = (SELECT COUNT(*)

2
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/dto/CutpointAirShhaftDto.java

@ -31,4 +31,6 @@ public class CutpointAirShhaftDto implements Serializable {
private String qzz_size;
private String product_area;
}

8
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/cutpointivt/service/impl/BstIvtCutpointivtServiceImpl.java

@ -128,8 +128,8 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
}
@Override
public List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String location) {
return bstIvtCutpointivtMapper.getAreaNotTaskPointByTcQzzPoint(location);
public List<CutpointAirShhaftDto> getAreaNotTaskPointByTcQzzPoint(String product_area) {
return bstIvtCutpointivtMapper.getAreaNotTaskPointByTcQzzPoint(product_area);
}
@Override
@ -161,8 +161,8 @@ public class BstIvtCutpointivtServiceImpl extends ServiceImpl<BstIvtCutpointivtM
}
@Override
public List<BstIvtCutpointivt> getNBJCanUsePoint(String type, String pointStatus, String area, String sort) {
return bstIvtCutpointivtMapper.getNBJCanUsePoint(type, pointStatus, area, sort);
public List<BstIvtCutpointivt> getNBJCanUsePoint(String type, String pointStatus, String product_area, String sort) {
return bstIvtCutpointivtMapper.getNBJCanUsePoint(type, pointStatus, product_area, sort);
}
@Override

14
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/IBstIvtShafttubeivtService.java

@ -47,11 +47,11 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
/**
* 获取启用的 类型 区域 有无轴的点位 (无任务)
* @param type 1,2,3,4,5,6
* @param location 0 1
* @param product_area 0 1
* @param have 0 1
* @return /
*/
List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String location, String have);
List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String product_area, String have);
/**
* 根据点位编码获取启用的点位
@ -73,10 +73,10 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
* 获得气胀轴库对应的气涨轴位置
* @param qzzSize 气涨轴尺寸
* @param pointCode 对应的穿拔轴机
* @param location 位置上半部分还是下半部分
* @param product_area 位置上半部分还是下半部分
* @return
*/
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize ,String pointCode, String location);
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize ,String pointCode, String product_area);
/**
* 获取没任务的气涨轴缓存位
@ -90,10 +90,10 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
* 获取没任务的气涨轴缓存位2
* @param qzzSize
* @param specification
* @param location
* @param product_area
* @return
*/
List<BstIvtShafttubeivt> getNotTaskShaftCache2(String qzzSize, String specification, String location);
List<BstIvtShafttubeivt> getNotTaskShaftCache2(String qzzSize, String specification, String product_area);
/**
* 获取没任务的空的位置
@ -107,7 +107,7 @@ public interface IBstIvtShafttubeivtService extends IService<BstIvtShafttubeivt>
* @param specification
* @return
*/
List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty2(String qzzSize, String specification);
List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty2(String qzzSize, String specification, String product_area);
/**
* 获取没任务的气涨轴缓存位

4
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/dao/BstIvtShafttubeivt.java

@ -61,6 +61,10 @@ public class BstIvtShafttubeivt implements Serializable {
/** 位置 */
private String point_location;
/**
* 生产区域
*/
private String product_area;
/** 是否有轴 */
private String have_qzz;

10
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/dao/mapper/BstIvtShafttubeivtMapper.java

@ -12,9 +12,9 @@ import java.util.List;
**/
public interface BstIvtShafttubeivtMapper extends BaseMapper<BstIvtShafttubeivt> {
List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String location, String have);
List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String product_area, String have);
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize ,String pointCode, String location);
List<BstIvtShafttubeivt> getByQzzSize(String qzzSize ,String pointCode, String product_area);
/**
* 获取含有气胀轴的气胀轴暂存位
@ -41,7 +41,7 @@ public interface BstIvtShafttubeivtMapper extends BaseMapper<BstIvtShafttubeivt>
* @return /
*/
List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty2(@Param("qzzSize") String qzzSize,
@Param("specification") String specification);
@Param("specification") String specification,@Param("product_area") String product_area);
/**
* 获取含有气胀轴的气胀轴暂存位
@ -62,10 +62,10 @@ public interface BstIvtShafttubeivtMapper extends BaseMapper<BstIvtShafttubeivt>
* 获取含有气胀轴的气胀轴暂存位
* @param qzzSize 气胀轴尺寸
* @param specification 标箔/锂电
* @param location 位置上下
* @param product_area 位置上下
* @return /
*/
List<BstIvtShafttubeivt> getNotTaskShaftCache2(@Param("qzzSize") String qzzSize,
@Param("specification") String specification,
@Param("location") String location);
@Param("product_area") String product_area);
}

14
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/dao/mapper/BstIvtShafttubeivtMapper.xml

@ -9,8 +9,8 @@
FROM
`bst_ivt_shafttubeivt` bst
WHERE bst.point_type = #{type}
<if test="location != null and location !=''">
AND bst.point_location = #{location}
<if test="product_area != null and product_area !=''">
AND bst.product_area = #{product_area}
</if>
AND bst.have_qzz = #{have} AND bst.is_used = '1'
AND 0 = (
@ -23,7 +23,7 @@
WHERE bsf.is_used = '1'
AND bsf.qzz_size = #{qzzSize}
AND bsf.point_type = '1'
AND bsf.point_location = #{location}
AND bsf.product_area = #{product_area}
AND bsf.parent_code = #{pointCode}
</select>
<select id="getNotTaskShaftCacheEmpty"
@ -49,11 +49,13 @@
AND b.point_type = '6'
AND b.qzz_size = #{qzzSize}
AND b.qzz_generation = #{specification}
AND b.product_area = #{product_area}
AND (b.plan <![CDATA[ <> ]]> '1' OR b.plan IS NULL)
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[ < ]]> '07' AND t.point_code2 = b.point_code AND t.is_delete = '0')
AND 0 = (SELECT COUNT(*) FROM bst_ivt_shafttubeivt bb WHERE bb.have_qzz ='1' AND bb.point_type = '6'
AND bb.qzz_generation = #{specification}
AND bb.qzz_size = #{qzzSize}
AND bb.product_area = #{product_area}
AND bb.sort_seq > b.sort_seq)
ORDER BY b.sort_seq ASC
</select>
@ -119,12 +121,8 @@
AND b.point_type = '6'
AND b.qzz_size = #{qzzSize}
AND b.qzz_generation = #{specification}
<if test="location != null and location !=''">
AND b.point_location = #{location}
</if>
AND b.point_location = #{location}
AND b.product_area = #{product_area}
AND 0 = (SELECT COUNT(*) FROM sch_base_task t WHERE t.task_status <![CDATA[ < ]]> '07' AND t.point_code1 = b.point_code)
AND (b.plan <![CDATA[ <> ]]> '1' OR b.plan IS NULL)
ORDER BY b.sort_seq DESC
</select>
</mapper>

16
lms/nladmin-system/src/main/java/org/nl/b_lms/bst/ivt/shafttubeivt/service/impl/BstIvtShafttubeivtServiceImpl.java

@ -91,8 +91,8 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
}
@Override
public List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String location, String have) {
return bstIvtShafttubeivtMapper.getAllShaftPointsByConditions(type, location, have);
public List<BstIvtShafttubeivt> getAllShaftPointsByConditions(String type, String product_area, String have) {
return bstIvtShafttubeivtMapper.getAllShaftPointsByConditions(type, product_area, have);
}
@Override
@ -118,8 +118,8 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
}
@Override
public List<BstIvtShafttubeivt> getByQzzSize(String qzzSize ,String pointCode, String location) {
return bstIvtShafttubeivtMapper.getByQzzSize(qzzSize,pointCode, location);
public List<BstIvtShafttubeivt> getByQzzSize(String qzzSize ,String pointCode, String product_area) {
return bstIvtShafttubeivtMapper.getByQzzSize(qzzSize,pointCode, product_area);
}
@Override
@ -128,8 +128,8 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
}
@Override
public List<BstIvtShafttubeivt> getNotTaskShaftCache2(String qzzSize, String specification, String location) {
return bstIvtShafttubeivtMapper.getNotTaskShaftCache2(qzzSize, specification, location);
public List<BstIvtShafttubeivt> getNotTaskShaftCache2(String qzzSize, String specification, String product_area) {
return bstIvtShafttubeivtMapper.getNotTaskShaftCache2(qzzSize, specification, product_area);
}
@Override
@ -138,8 +138,8 @@ public class BstIvtShafttubeivtServiceImpl extends ServiceImpl<BstIvtShafttubeiv
}
@Override
public List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty2(String qzzSize, String specification) {
return bstIvtShafttubeivtMapper.getNotTaskShaftCacheEmpty2(qzzSize, specification);
public List<BstIvtShafttubeivt> getNotTaskShaftCacheEmpty2(String qzzSize, String specification, String product_area) {
return bstIvtShafttubeivtMapper.getNotTaskShaftCacheEmpty2(qzzSize, specification, product_area);
}
@Override

43
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/TrussCallAirShaftTask.java

@ -150,49 +150,6 @@ public class TrussCallAirShaftTask extends AbstractAcsTask {
.eq(PdmBiSlittingproductionplan::getIs_delete, SlitterConstant.SLITTER_NO);
slittingproductionplanService.update(updateWrapper);
}
} else{//若无接续则取消预分配的气胀轴空位
//尺寸
String qzzSize = jsonObject.getString("qzz_size");
//代数
String qzzGeneration = jsonObject.getString("qzz_generation");
//区域
String location = endPointObj.getPoint_location();
//若点位是短区,且计划需要4短;若点位是长区,且计划需要5长
if ((StrUtil.equals(qzzGeneration, "4") && StrUtil.equals(location, "0")) || (StrUtil.equals(qzzGeneration, "5") && StrUtil.equals(location, "1")))
{
// 查询拔轴设备旁边缓存架点位是否存在
List<BstIvtShafttubeivt> shafttubeivts = shafttubeivtService.getByQzzSize(qzzSize ,endPointObj.getPoint_code(), location);
// 对应尺寸的气涨轴库
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
//若预分配的是缓存架,则取消缓存架
if(StrUtil.equals(shafttubeivt.getPlan(), "1")){
shafttubeivt.setPlan("");
shafttubeivt.setUpdate_time(DateUtil.now());
shafttubeivtService.updateById(shafttubeivt);
log.info("预分配缓存架空位被取消 - {}", shafttubeivt);
}else{
List<BstIvtShafttubeivt> qzzCache = shafttubeivtService.getNotTaskShaftCacheEmpty3(qzzSize,qzzGeneration);
if (qzzCache.size() > 0) {
// 预扣除暂存架库存
BstIvtShafttubeivt waitUsedPoint = qzzCache.get(0);
waitUsedPoint.setPlan("");
waitUsedPoint.setUpdate_time(DateUtil.now());
shafttubeivtService.updateById(waitUsedPoint);
log.info("预分配暂存架空位被取消 - {}", waitUsedPoint);
}
}
}else{
// 根据尺寸和代数,查询气涨轴暂存架是否有库存
List<BstIvtShafttubeivt> qzzCache = shafttubeivtService.getNotTaskShaftCacheEmpty3(qzzSize,qzzGeneration);
if (qzzCache.size() > 0) {
// 预扣除暂存架库存
BstIvtShafttubeivt waitUsedPoint = qzzCache.get(0);
waitUsedPoint.setPlan("");
waitUsedPoint.setUpdate_time(DateUtil.now());
shafttubeivtService.updateById(waitUsedPoint);
log.info("预分配暂存架空位被取消 - {}", waitUsedPoint);
}
}
}
}
task.setUpdate_time(DateUtil.now());

310
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/auto/AutoCallAirShaftTask.java

@ -27,14 +27,12 @@ import org.nl.b_lms.sch.tasks.slitter.StockAreaSendVehicleTask;
import org.nl.b_lms.sch.tasks.slitter.TrussCallAirShaftTask;
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterConstant;
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
import org.nl.b_lms.sch.tasks.slitter.mapper.SlitterMapper;
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.BhTubeMovePointDto;
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.BhTubePointDto;
import org.nl.b_lms.sch.tasks.slitter.mapper.dto.SlitterPlanDistinctDto;
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
import org.nl.common.enums.NoticeTypeEnum;
import org.nl.common.utils.TaskUtils;
import org.nl.modules.common.utils.RedisUtils;
import org.nl.system.service.notice.ISysNoticeService;
import org.nl.system.service.param.ISysParamService;
import org.nl.system.service.param.dao.Param;
@ -85,18 +83,12 @@ public class AutoCallAirShaftTask extends Prun {
private IschBaseTaskService taskService;
@Autowired
private ISysParamService paramService;
@Autowired
private RedisUtils redisUtils;
@Autowired
private SlitterMapper slitterMapper;
public final static String PARAM_CODE_PLAN_AREA = "PARAM_CODE_PLAN_AREA";
public final static String IS_ONLY_PULLING = "IS_ONLY_PULLING";
public final static String TZ_DAY = "TZ_DAY";
public final static String USE_XN = "USE_XN";
public final static String MAX_QZZ_NUM = "MAX_QZZ_NUM";
public String stepStr = "";
public List<String> stepErrorInfo = new ArrayList<>();
public void run() {
@ -116,9 +108,7 @@ public class AutoCallAirShaftTask extends Prun {
"", "0");
//循环点位,最多循环两次
for (BstIvtShafttubeivt empty : emptyPoints) {
stepErrorInfo = new ArrayList<>();
doCallShaft(isOnlyPulling, tzDay, tzArea, useXn, max_qzz_num);
redisUtils.set("ERROR" + empty.getPoint_code(), stepErrorInfo);
}
}
@ -133,7 +123,7 @@ public class AutoCallAirShaftTask extends Prun {
@Transactional(rollbackFor = Exception.class)
public void doCallShaft(Param isOnlyPulling, Param tzDay, Param tzArea, Param useXn, Param max_qzz_num) {
//查询套轴缓存位:点位启用、有子卷、气胀轴字段不为空、且无未完成的任务
List<CutpointAirShhaftDto> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByTcQzzPoint("0");
List<CutpointAirShhaftDto> notTaskPoints = bcutpointivtService.getAreaNotTaskPointByTcQzzPoint("");
//若有拔轴任务,则会执行本段代码
//对满足的需拔轴子卷遍历下发任务,同时每次拔轴下发前判断是否有可以接续的套轴计划
for(int i= 0;i<notTaskPoints.size();i++){
@ -165,24 +155,17 @@ public class AutoCallAirShaftTask extends Prun {
}
//需拔子卷计划
PdmBiSlittingproductionplan plan = list.get(0);
//再次查询空的拔轴机构点位,优先查同区的拔轴设备
//再次查询空的拔轴机构点位,查同区的拔轴设备
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
cutpointivt.getPoint_location(), "0");
cutpointivt.getProduct_area(), "0");
if(emptyPoints.size() == 0){
String point_location = "0";
if (StrUtil.equals(cutpointivt.getPoint_location(), "0"))
point_location = "1";
if (StrUtil.equals(cutpointivt.getPoint_location(), "1"))
point_location = "0";
emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
point_location, "0");
if(emptyPoints.size() == 0){
log.warn("气涨轴[{}]排队中,暂时无空闲拔轴机构!", qzzNo);
bcutpointivtService.update(new UpdateWrapper<BstIvtCutpointivt>()
.eq("ivt_id",cutpointivt.getIvt_id())
.set("remark","排队中,暂时无空闲拔轴机构!")
.set("update_time",DateUtil.now()));
//跳过当前子卷
//跳过当前子卷任务
continue;
}
}
@ -213,7 +196,6 @@ public class AutoCallAirShaftTask extends Prun {
//判断系统参数是否只做拔轴
if (ObjectUtil.isNotEmpty(isOnlyPulling) && SlitterConstant.SLITTER_YES.equals(isOnlyPulling.getValue())) {
stepErrorInfo.add("系统设置了只做拔轴,详细看参数表:" + IS_ONLY_PULLING);
//校验是否有空气胀轴位
if(!this.havaEmptyShaft(emptyPoints.get(0),plan,max_qzz_num)) {
log.warn("气涨轴[{}]排队中,暂时无空闲气胀轴空位放空轴!", qzzNo);
@ -297,6 +279,7 @@ public class AutoCallAirShaftTask extends Prun {
setIsSleeveShaft(param);
// 当前拔轴的分切计划,一根轴最多2卷子卷
List<PdmBiSlittingproductionplan> oldPlans = slittingproductionplanService.getByQzzNo(qzzNo);
// 保存所需要的分切计划数据到点位上(套轴对接位)更新分切计划
saveCutPlanMessage(emptyPoints.get(0), needPlans, qzzSize, needPlan.getQzz_generation());
//设置当前的拔管纸管信息到param里
@ -322,7 +305,6 @@ public class AutoCallAirShaftTask extends Prun {
//拔轴任务循环已结束,判断系统参数是否只做拔轴,若否进入套轴计划判断循环
if (!(ObjectUtil.isNotEmpty(isOnlyPulling) && SlitterConstant.SLITTER_YES.equals(isOnlyPulling.getValue()))) {
log.error("系统设置了只做拔轴,详细看参数表:" + IS_ONLY_PULLING);
stepErrorInfo.add("系统设置了只做拔轴,详细看参数表:" + IS_ONLY_PULLING);
//获取可下发的分切计划
List<SlitterPlanDistinctDto> plans = this.getCanIssuedCutPlan(tzDay, tzArea, useXn);
//对满足的计划遍历下发任务
@ -332,24 +314,17 @@ public class AutoCallAirShaftTask extends Prun {
String qzzSize = planDto.getQzz_size();
//计划中需要的气胀轴代数
String qzz_generation = planDto.getQzz_generation();
String location = "0";
String product_area = "";
if (StrUtil.equals(qzz_generation, "4")){
location = "0";
product_area = "A";
}else if (StrUtil.equals(qzz_generation, "5")){
location = "1";
product_area = "B";
}
//再次查询空的拔轴机构点位,优先查同区的拔轴设备
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
location, "0");
product_area, "0");
if(emptyPoints.size() == 0){
if (StrUtil.equals(location, "0")){
location = "1";
}else if (StrUtil.equals(location, "1")){
location = "0";
}
emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
location, "0");
if(emptyPoints.size() == 0){
log.warn("分切计划{}排队中,暂时无空闲拔轴机构!", planDto.getWorkorder_id());
slittingproductionplanService.update(new UpdateWrapper<PdmBiSlittingproductionplan>()
@ -391,7 +366,6 @@ public class AutoCallAirShaftTask extends Prun {
// 调用ACS滚条气涨轴下来
if (!toAcsOutShaft(planDto, emptyPoints.get(0))) {
log.error("呼叫出轴失败-穿拔轴{}不进行套轴,跳过!", emptyPoints.get(0).getPoint_code());
stepErrorInfo.add("呼叫出轴失败-穿拔轴" + emptyPoints.get(0).getPoint_code() + "不进行套轴,跳过!");
return;
}
//调用agv换托盘
@ -438,77 +412,19 @@ public class AutoCallAirShaftTask extends Prun {
String qzzSize = planD.getQzz_size();
//代数4或5
String qzzGeneration = planD.getQzz_generation();
//当前拔轴设备所在区域0或1
String location = empty.getPoint_location();
//当前拔轴设备所在区域
String product_area = empty.getProduct_area();
// 根据尺寸和代数,查询气涨轴暂存架是否有库存
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCache2(qzzSize,
qzzGeneration, "");
qzzGeneration, product_area);
if (qzzCache.size() > 0) {
return true;
}
else{//若暂存架无库存,根据当前拔轴设备所在区域判断是否有缓存架,以及缓存架是否有库存
//若点位是短区,且计划需要4短;若点位是长区,且计划需要5长
if ((StrUtil.equals(qzzGeneration, "4") && StrUtil.equals(location, "0")) || (StrUtil.equals(qzzGeneration, "5") && StrUtil.equals(location, "1"))){
// 查询拔轴设备旁边缓存架点位是否存在
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), location);
if (shafttubeivts.size() == 0) {
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴缓存位");
return false;
}
// 对应尺寸的气涨轴库
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
//判断是否存在残留的脏数据
String plan = shafttubeivt.getPlan();
if(ObjectUtil.isNotEmpty(plan) && StrUtil.equals(plan, "1")){
log.error("气胀轴库" + shafttubeivt.getPoint_code() + "预分配字段plan异常,需要确认并初始化!");
return false;
}
// 判断气胀轴是否有轴
JSONArray device_rows = new JSONArray();
JSONObject device_obj = new JSONObject();
device_rows.add(device_obj);
device_obj.put("device_code", shafttubeivt.getPoint_code());
device_obj.put("product_area", "B1");
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
log.error("获取气胀轴库信息失败");
return false;
}
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
if (data2.getInteger("qty") > 0) {
return true;
}else{
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴。");
return false;
}
}
}
return false;
}
/**
* 判断是不是有足够的 对应尺寸代数的气胀轴空位
* @param empty 当前分配的拔轴设备点位
* @param plan 当前需拔轴的计划信息
* @param max_qzz_num 气胀轴缓存架最大缓存数量
* @return true 有空位 false无空位
*/
public boolean havaEmptyShaft(BstIvtShafttubeivt empty, PdmBiSlittingproductionplan plan, Param max_qzz_num) {
//气胀轴尺寸3寸或6寸
String qzzSize = plan.getQzz_size();
//代数4或5
String qzzGeneration = plan.getQzz_generation();
//当前拔轴设备所在区域0或1
String location = empty.getPoint_location();
//获取气胀轴缓存架最大缓存数量
Integer max_num = Integer.valueOf(max_qzz_num.getValue());
//若点位是短区,且计划需要4短;若点位是长区,且计划需要5长
if ((StrUtil.equals(qzzGeneration, "4") && StrUtil.equals(location, "0")) || (StrUtil.equals(qzzGeneration, "5") && StrUtil.equals(location, "1")))
{
else{
//若暂存架无库存,根据当前拔轴设备所在区域判断是否有缓存架,以及缓存架是否有库存
// 查询拔轴设备旁边缓存架点位是否存在
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), location);
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), product_area);
if (shafttubeivts.size() == 0) {
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴缓存位");
return false;
@ -516,49 +432,80 @@ public class AutoCallAirShaftTask extends Prun {
// 对应尺寸的气涨轴库
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
//判断是否存在残留的脏数据
String planStr = shafttubeivt.getPlan();
if(ObjectUtil.isNotEmpty(planStr) && StrUtil.equals(planStr, "1")){
String plan = shafttubeivt.getPlan();
if(ObjectUtil.isNotEmpty(plan) && StrUtil.equals(plan, "1")){
log.error("气胀轴库" + shafttubeivt.getPoint_code() + "预分配字段plan异常,需要确认并初始化!");
return false;
}
// 判断气胀轴是否有轴
JSONArray device_rows = new JSONArray();
JSONObject device_obj = new JSONObject();
device_rows.add(device_obj);
device_obj.put("device_code", shafttubeivt.getPoint_code());
device_obj.put("product_area", "B1");
device_obj.put("product_area", product_area);
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
log.error("获取气胀轴库信息失败");
return false;
}
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
//若缓存架数量已经满了
if (data2.getInteger("qty") >= max_num) {
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴空位。");
// 根据尺寸和代数,查询气涨轴暂存架是否有空位
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCacheEmpty2(qzzSize,qzzGeneration);
if (qzzCache.size() <= 0) {
log.warn("气胀轴暂存架没空位,无法分配拔轴任务");
return false;
}
// 预扣除暂存架库存
BstIvtShafttubeivt waitUsedPoint = qzzCache.get(0);
waitUsedPoint.setPlan("1");
waitUsedPoint.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(waitUsedPoint);
log.info("暂存架空位被预分配 - {}", waitUsedPoint);
if (data2.getInteger("qty") > 0) {
return true;
}else{
// 预扣除缓存架库存
shafttubeivt.setPlan("1");
shafttubeivt.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(shafttubeivt);
log.info("缓存架空位被预分配 - {}", shafttubeivt);
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴。");
return false;
}
}
}
/**
* 判断是不是有足够的 对应尺寸代数的气胀轴空位
* @param empty 当前分配的拔轴设备点位
* @param plan 当前需拔轴的计划信息
* @param max_qzz_num 气胀轴缓存架最大缓存数量
* @return true 有空位 false无空位
*/
public boolean havaEmptyShaft(BstIvtShafttubeivt empty, PdmBiSlittingproductionplan plan, Param max_qzz_num) {
//气胀轴尺寸3寸或6寸
String qzzSize = plan.getQzz_size();
//代数4或5
String qzzGeneration = plan.getQzz_generation();
//当前拔轴设备所在区域
String product_area = empty.getProduct_area();
//获取气胀轴缓存架最大缓存数量
Integer max_num = Integer.valueOf(max_qzz_num.getValue());
}else{
// 根据尺寸和代数,查询气涨轴暂存架是否有库存
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCacheEmpty2(qzzSize,qzzGeneration);
// 查询拔轴设备旁边缓存架点位是否存在
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), product_area);
if (shafttubeivts.size() == 0) {
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴缓存位");
return false;
}
// 对应尺寸的气涨轴库
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
//判断是否存在残留的脏数据
String planStr = shafttubeivt.getPlan();
if(ObjectUtil.isNotEmpty(planStr) && StrUtil.equals(planStr, "1")){
log.error("气胀轴库" + shafttubeivt.getPoint_code() + "预分配字段plan异常,需要确认并初始化!");
return false;
}
// 判断气胀轴是否有轴
JSONArray device_rows = new JSONArray();
JSONObject device_obj = new JSONObject();
device_rows.add(device_obj);
device_obj.put("device_code", shafttubeivt.getPoint_code());
device_obj.put("product_area", product_area);
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
log.error("获取气胀轴库信息失败");
return false;
}
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
//若缓存架数量已经满了
if (data2.getInteger("qty") >= max_num) {
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴空位。");
// 根据尺寸和代数和车间区域,查询气涨轴暂存架是否有空位
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCacheEmpty2(qzzSize,qzzGeneration,product_area);
if (qzzCache.size() <= 0) {
log.warn("气胀轴暂存架没空位,无法分配拔轴任务");
return false;
@ -569,7 +516,14 @@ public class AutoCallAirShaftTask extends Prun {
waitUsedPoint.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(waitUsedPoint);
log.info("暂存架空位被预分配 - {}", waitUsedPoint);
}else{
// 预扣除缓存架库存
shafttubeivt.setPlan("1");
shafttubeivt.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(shafttubeivt);
log.info("缓存架空位被预分配 - {}", shafttubeivt);
}
return true;
}
@ -640,6 +594,7 @@ public class AutoCallAirShaftTask extends Prun {
// 兜底
needQuantity = needTemp > 0 ? needTemp : 1;
}
// todo: 要考虑type=0的正在搬运往套轴区三个点的托盘是否有该库存,如有直接返回true
// 查找type=0的位置(待命的托盘)中是否存在(需要判断的是单独一个托盘) 校验了不在搬运中
List<BhTubePointDto> stockingivtList = stockingivtService.getNeedPaperTubePoint("0", tubes.get(0), location);
// 找一个点位: 目的需要的点位
@ -656,7 +611,6 @@ public class AutoCallAirShaftTask extends Prun {
noticeService.createNotice("备货区找不到[" + tubes.get(0) + "]的纸管信息",
"点位[" + empty.getPoint_name() + "]无法从备货区找到纸管信息",
NoticeTypeEnum.EXCEPTION.getCode());
stepErrorInfo.add("备货区找不到[" + tubes.get(0) + "]的纸管信息");
return false;
}
// 找到就创建AGV搬运任务
@ -685,7 +639,6 @@ public class AutoCallAirShaftTask extends Prun {
noticeService.createNotice("备货区找不到空位置搬运",
"点位[" + empty.getPoint_name() + "]无法从备货区找到空位",
NoticeTypeEnum.EXCEPTION.getCode());
stepErrorInfo.add("备货区找不到空位置搬运。");
return false;
}
BstIvtStockingivt endPoint = list.get(0);
@ -699,14 +652,12 @@ public class AutoCallAirShaftTask extends Prun {
param.put("task_type", SlitterEnum.TASK_TYPE.code("备货区送载具"));
param.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
stockAreaSendVehicleTask.createTask(param);
stepErrorInfo.add("备货区交换托盘中...请等待。");
return true;
}
/**
* 获取对应的气胀轴库1
*
* @param empty 套拔轴点位
*/
private Boolean toAcsOutShaft(SlitterPlanDistinctDto planD, BstIvtShafttubeivt empty) {
@ -716,26 +667,29 @@ public class AutoCallAirShaftTask extends Prun {
//代数4或5
String qzzGeneration = planD.getQzz_generation();
//当前拔轴设备所在区域0或1
String location = empty.getPoint_location();
String product_area = empty.getProduct_area();
//若点位是短区,且计划需要4短;若点位是长区,且计划需要5长
if ((StrUtil.equals(qzzGeneration, "4") && StrUtil.equals(location, "0")) || (StrUtil.equals(qzzGeneration, "5") && StrUtil.equals(location, "1")))
{
// 查询拔轴设备旁边缓存架点位是否存在
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), location);
if (shafttubeivts.size() == 0) {
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴缓存位");
return false;
}
// 对应尺寸的气涨轴库
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
// 判断气胀轴是否有轴
// 查询拔轴设备旁边缓存架点位是否存在
List<BstIvtShafttubeivt> shafttubeivts = bstIvtShafttubeivtService.getByQzzSize(qzzSize ,empty.getPoint_code(), product_area);
if (shafttubeivts.size() == 0) {
log.error("气胀轴库找不到[" + qzzSize + "]规格的气涨轴缓存位");
return false;
}
// 对应尺寸的气涨轴库
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
// 根据尺寸和代数,查询气涨轴缓存架是否有库存
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCache2(qzzSize,
qzzGeneration, product_area);
if (qzzCache.size() <= 0) {
log.warn("没有气胀轴,不给ACS写出轴信息");
//判断暂存架是否有库存
JSONArray device_rows = new JSONArray();
JSONObject device_obj = new JSONObject();
device_rows.add(device_obj);
device_obj.put("device_code", shafttubeivt.getPoint_code());
//
device_obj.put("product_area", "B1");
device_obj.put("product_area", product_area);
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
if (ObjectUtil.isEmpty(pointStatus) || ObjectUtil.isEmpty(pointStatus.getJSONArray("data"))) {
log.error("获取气胀轴库信息失败");
@ -744,66 +698,21 @@ public class AutoCallAirShaftTask extends Prun {
JSONObject data2 = pointStatus.getJSONArray("data").getJSONObject(0);
if (data2.getInteger("qty") <= 0) {
log.warn("气胀轴库【" + shafttubeivt.getPoint_code() + "】没有气胀轴。");
// 根据尺寸和代数,查询气涨轴暂存架是否有库存
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCache2(qzzSize,
qzzGeneration, "");
if (qzzCache.size() <= 0) {
log.warn("没有气胀轴,不给ACS写出轴信息");
return false;
}
// 预扣除暂存架库存
BstIvtShafttubeivt waitUsedPoint = qzzCache.get(0);
waitUsedPoint.setPlan("1");
waitUsedPoint.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(waitUsedPoint);
}else{
// 预扣除缓存架库存
shafttubeivt.setPlan("1");
shafttubeivt.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(shafttubeivt);
}
// 判断气胀轴密集库是否有数据
JSONArray acsParam = new JSONArray();
// 出轴的信号,若缓存架没轴,电气会通过acs申请acsCallShaftFromCache,从暂存架出轴
JSONObject acsQzz = new JSONObject();
acsQzz.put("device_code", shafttubeivt.getPoint_code());
acsQzz.put("code", "to_command");
acsQzz.put("value", "1");
acsQzz.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
acsParam.add(acsQzz);
log.info("开始给ACS写信号出气胀轴 - {}", acsQzz);
JSONObject action = wmsToAcsService.action(acsParam);
log.info("下发给ACS写信号出气涨轴返回参数:{}", action);
}else{
// 根据尺寸和代数,查询气涨轴暂存架是否有库存
List<BstIvtShafttubeivt> qzzCache = bstIvtShafttubeivtService.getNotTaskShaftCache2(qzzSize,
qzzGeneration, "");
if (qzzCache.size() > 0) {
// 判断气胀轴密集库是否有数据
JSONArray acsParam = new JSONArray();
// 出轴的信号,若缓存架没轴,电气会通过acs申请acsCallShaftFromCache,从暂存架出轴
JSONObject acsQzz = new JSONObject();
acsQzz.put("device_code", empty.getPoint_code());
acsQzz.put("code", "to_command");
// todo: 需要和电气沟通协议,直接从暂存架出轴
acsQzz.put("value", "1");
acsQzz.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
acsParam.add(acsQzz);
log.info("开始给ACS写信号出气胀轴 - {}", acsQzz);
JSONObject action = wmsToAcsService.action(acsParam);
log.info("下发给ACS写信号出气涨轴返回参数:{}", action);
// 预扣除暂存架库存
BstIvtShafttubeivt waitUsedPoint = qzzCache.get(0);
waitUsedPoint.setPlan("1");
waitUsedPoint.setUpdate_time(DateUtil.now());
bstIvtShafttubeivtService.updateById(waitUsedPoint);
}else{
log.warn("没有气胀轴,不给ACS写出轴信息");
return false;
}
}
// 判断气胀轴密集库是否有数据
JSONArray acsParam = new JSONArray();
// 出轴的信号,若缓存架没轴,电气会通过acs申请acsCallShaftFromCache,从暂存架出轴
JSONObject acsQzz = new JSONObject();
acsQzz.put("device_code", shafttubeivt.getPoint_code());
acsQzz.put("code", "to_command");
acsQzz.put("value", "1");
acsQzz.put("product_area", SlitterConstant.SLITTER_TASK_AREA);
acsParam.add(acsQzz);
log.info("开始给ACS写信号出气胀轴 - {}", acsQzz);
JSONObject action = wmsToAcsService.action(acsParam);
log.info("下发给ACS写信号出气涨轴返回参数:{}", action);
return true;
}
@ -820,7 +729,6 @@ public class AutoCallAirShaftTask extends Prun {
empty.setHave_qzz(SlitterConstant.SLITTER_YES);
empty.setQzz_size(qzzSize);
empty.setQzz_generation(qzz_generation);
TaskUtils.updateOptMessageByBShaftPoint(empty);
for (PdmBiSlittingproductionplan plan : needPlans) {

18
lms/nladmin-system/src/main/java/org/nl/b_lms/sch/tasks/slitter/service/impl/SlitterServiceImpl.java

@ -55,7 +55,6 @@ import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
@ -781,17 +780,18 @@ public class SlitterServiceImpl implements SlitterService {
throw new BadRequestException("子卷[" + plan.getContainer_name() + "]对应的级别不能为空");
}
log.info("分切计划数据:{}", plan);
// plan.setLevel("4");
String point_type = "5".equals(plan.getLevel()) ? "5" : "4";
// todo 如果是成品称重,需要Lms分配一个空位point_code2
// 查找终点 确认是废箔还是成品: 根据分切计划的子卷等级来区分,5为报废
BstIvtShafttubeivt one = shafttubeivtService.getOne(new LambdaQueryWrapper<BstIvtShafttubeivt>()
.eq(BstIvtShafttubeivt::getPoint_type, point_type)
.eq(BstIvtShafttubeivt::getPoint_location, device.getPoint_location())
.eq(BstIvtShafttubeivt::getIs_used, SlitterConstant.SLITTER_YES));
JSONObject taskParam = new JSONObject();
//
taskParam.put("point_code2", one.getPoint_code());
taskParam.put("material_code", plan.getContainer_name());
// todo: ????
//是否打印标签
taskParam.put("to_is_labeling", "0");
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "请求成功!");
@ -903,10 +903,10 @@ public class SlitterServiceImpl implements SlitterService {
.eq(MdPbPapervehicle::getRow_num, param.getString("row_num"))
.eq(MdPbPapervehicle::getCol_num, param.getString("col_num")));
if (ObjectUtil.isEmpty(mdPbPapervehicle)) {
log.warn("托盘:" + vehicleCode + "第" + param.getString("row_num") + "-" + param.getString("col_num") + "没数据!");
throw new BadRequestException("托盘:" + vehicleCode + "第" + param.getString("row_num") + "-" + param.getString("col_num") + "行没数据!");
log.warn("托盘:" + vehicleCode + "第" + param.getString("row_num")+"-"+param.getString("col_num") + "没数据!");
throw new BadRequestException("托盘:" + vehicleCode + "第" + param.getString("row_num")+"-"+param.getString("col_num") + "行没数据!");
}
log.debug("更新前" + vehicleCode + "数据:" + mdPbPapervehicle);
log.debug("更新前" + vehicleCode + "数据:" + mdPbPapervehicle);
if (mdPbPapervehicle != null || mdPbPapervehicle.getQty().intValue() > 0) {
boolean remove = papervehicleService.removeById(mdPbPapervehicle);
log.debug("删除0结果:" + vehicleCode + ":" + remove);
@ -973,7 +973,6 @@ public class SlitterServiceImpl implements SlitterService {
shaftPoint.setContainer_name1("");
shaftPoint.setContainer_name2("");
shaftPoint.setQzz_size("");
shaftPoint.setQzz_generation("");
TaskUtils.updateOptMessageByBShaftPoint(shaftPoint);
shafttubeivtService.update(shaftPoint);
JSONObject res = new JSONObject();
@ -1074,7 +1073,7 @@ public class SlitterServiceImpl implements SlitterService {
} else {
throw new BadRequestException("操作失败,点位[" + pointCode + "]无气胀轴信息,请先绑定子卷库存!");
}
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", point.getPoint_location(), "2");
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", point.getProduct_area(), "2");
if (areaEmptyNotTaskPoint.size() <= 1) {
throw new BadRequestException("请求搬运失败,内包间没有可存放位置!");
}
@ -2470,7 +2469,7 @@ public class SlitterServiceImpl implements SlitterService {
JSONObject taskParam = new JSONObject();
// 获取内包间缓存位
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", point.getPoint_location(), "2");
List<BstIvtCutpointivt> areaEmptyNotTaskPoint = bcutpointivtService.getNBJCanUsePoint("1", "1", point.getProduct_area(), "2");
if (areaEmptyNotTaskPoint.size() <= 1) {
throw new BadRequestException("请求搬运失败,内包间没有可存放位置!");
}
@ -2505,7 +2504,6 @@ public class SlitterServiceImpl implements SlitterService {
}
return res;
}
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject downBait(JSONObject param) {

2
lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java

@ -159,7 +159,7 @@ public interface AcsToWmsService {
JSONObject slitterApply(JSONObject param);
/**
* 二期内包间送子卷请求
* 二期套管工位请求判断去成品还是废箔
* @param param /
* @return /
*/

Loading…
Cancel
Save