fix: 开放套轴1700,依旧禁用1800,开放套轴天数自定义设置

This commit is contained in:
2024-08-20 13:51:42 +08:00
parent a2214ec829
commit d8c5990f7b
6 changed files with 30 additions and 17 deletions

View File

@@ -46,9 +46,10 @@ public interface IPdmBiSlittingproductionplanService extends IService<PdmBiSlitt
/**
* 获取可用的分切计划
* @param day 天数
* @return /
*/
List<SlitterPlanDistinctDto> getAllCutPlan();
List<SlitterPlanDistinctDto> getAllCutPlan(Integer day);
/**
* 通过气涨轴编码获取分切计划

View File

@@ -12,7 +12,7 @@ import java.util.List;
**/
public interface PdmBiSlittingproductionplanMapper extends BaseMapper<PdmBiSlittingproductionplan> {
List<SlitterPlanDistinctDto> getAllCutPlan();
List<SlitterPlanDistinctDto> getAllCutPlan(Integer day);
List<SlitterPlanDistinctDto> getAllHalfPlan(List<String> qzzs);

View File

@@ -70,8 +70,7 @@
AND p.is_delete = '0'
AND IFNULL(p.up_or_down,'') <![CDATA[ <> ]]> ''
AND IFNULL(p.left_or_right,'') <![CDATA[ <> ]]> ''
AND DATE(p.start_time) = CURDATE()
AND p.FRP_description NOT LIKE '%1700%'
AND DATE(p.start_time) >= DATE_SUB(CURDATE(), INTERVAL #{day} DAY)
AND p.FRP_description NOT LIKE '%1800%'
GROUP BY
p.resource_name,

View File

@@ -84,8 +84,8 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
}
@Override
public List<SlitterPlanDistinctDto> getAllCutPlan() {
return pdmBiSlittingproductionplanMapper.getAllCutPlan();
public List<SlitterPlanDistinctDto> getAllCutPlan(Integer day) {
return pdmBiSlittingproductionplanMapper.getAllCutPlan(day);
}
@Override

View File

@@ -36,13 +36,12 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.*;
import static org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil.doSavePaperInfos;
/**
* @Author: lyd
@@ -84,6 +83,7 @@ public class AutoCallAirShaftTask {
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";
/**
* hint: 目前只是考虑了上区域
@@ -97,6 +97,10 @@ public class AutoCallAirShaftTask {
@Transactional(rollbackFor = Exception.class)
public void run() {
log.info("自动呼叫套轴开始执行...");
// 判断配置参数是否只做拔轴
Param isOnlyPulling = paramService.findByCode(IS_ONLY_PULLING);
Param tzDay = paramService.findByCode(TZ_DAY);
Param paramObj = paramService.findByCode(PARAM_CODE_PLAN_AREA);
// 1、获取空的插拔轴位(无任务)
List<BstIvtShafttubeivt> emptyPoints = bstIvtShafttubeivtService.getAllShaftPointsByConditions("2",
"0", "0");
@@ -104,16 +108,14 @@ public class AutoCallAirShaftTask {
// 标箔1锂电2 改大小4代5代
String specification = empty.getQzz_generation();
String location = empty.getPoint_location();
// 判断配置参数是否只做拔轴
Param isOnlyPulling = paramService.findByCode(IS_ONLY_PULLING);
if (ObjectUtil.isNotEmpty(isOnlyPulling) && SlitterConstant.SLITTER_YES.equals(isOnlyPulling.getValue())) {
// 只做拔轴
makePullShaft(empty, specification);
return;
}
Integer integer = Integer.valueOf(ObjectUtil.isEmpty(tzDay.getValue()) ? "0" : tzDay.getValue());
// 2、获取分切计划数据 校验代数 todo 顺序可能需要考虑
List<SlitterPlanDistinctDto> planAll = slittingproductionplanService.getAllCutPlan();
Param paramObj = paramService.findByCode(PARAM_CODE_PLAN_AREA);
List<SlitterPlanDistinctDto> planAll = slittingproductionplanService.getAllCutPlan(integer);
String value = paramObj.getValue();
List<String> prefixList = Arrays.asList(value.split("[,]"));
List<SlitterPlanDistinctDto> plans = planAll.stream()
@@ -133,6 +135,7 @@ public class AutoCallAirShaftTask {
"1", location, "0");
// 如果满了就只做拔轴 预留一个货位,防止套轴直接站满
if (emptyShaftPoint.size() == 0) {
log.info("暂存位没有空位!正在检测是否存在半个点位!");
// 校验是否存在半个位置,且有分切计划
// 获取只有一个位置的点位
List<BstIvtCutpointivt> halfPlacePoint = bcutpointivtService.getAllHalfPlacePoints("1",
@@ -141,6 +144,7 @@ public class AutoCallAirShaftTask {
.map(p -> ObjectUtil.isNotEmpty(p.getQzz_no1()) ? p.getQzz_no1() : p.getQzz_no2())
.collect(Collectors.toList());
if (qzzs.size() == 0) {
log.info("没有半个点位,或者对应的另一半分切计划没有找到!");
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, specification);
return;
@@ -148,13 +152,15 @@ public class AutoCallAirShaftTask {
// 从寻查找分切计划并放在plans, 没有考虑区域问题, 里面会考虑代数
plans = slittingproductionplanService.getAllHalfPlan(qzzs);
if (plans.size() == 0) {
log.info("没有找到对应的另一半分切计划没有找到");
// 如果不需要套轴,就只做拔轴
makePullShaft(empty, specification);
return;
}
log.info("找到对应的另一半的计划 - {}", plans);
}
// 获取一个分切计划的Dto。如果是6寸可以直接使用、如果是3寸需要判断当前位置是否满足
// todo: 需要校验分切设备是在对应的区域
// todo: 需要校验分切设备是在对应的区域
SlitterPlanDistinctDto planDto = plans.stream()
.filter(planD -> "6".equals(planD.getQzz_size()) ||
("3".equals(planD.getQzz_size()) && specification.equals(planD.getQzz_generation())))
@@ -257,6 +263,7 @@ public class AutoCallAirShaftTask {
/**
* 设置是否套轴
*
* @param param 任务map
*/
public void setIsSleeveShaft(JSONObject param) {
@@ -363,7 +370,6 @@ public class AutoCallAirShaftTask {
throw new BadRequestException("气胀轴库找不到[" + qzzSize + "]规格的气涨轴位");
}
BstIvtShafttubeivt shafttubeivt = shafttubeivts.get(0);
log.info("开始给ACS写信号出气胀轴");
JSONArray acsParam = new JSONArray();
JSONObject acsQzz = new JSONObject();
acsQzz.put("device_code", shafttubeivt.getPoint_code());
@@ -371,6 +377,7 @@ public class AutoCallAirShaftTask {
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);
}
@@ -378,9 +385,9 @@ public class AutoCallAirShaftTask {
/**
* 创建气涨轴缓存的桁架任务
*
* @param qzzSize 气涨轴尺寸
* @param location 位置:上半部分还是下半部分
* @param empty 套拔轴点位
* @param qzzSize 气涨轴尺寸
* @param location 位置:上半部分还是下半部分
* @param empty 套拔轴点位
*/
private void toCreatShaftCacheTask(String qzzSize, String location, BstIvtShafttubeivt empty) {
// 获取气涨轴缓存没有任务的点位
@@ -500,6 +507,7 @@ public class AutoCallAirShaftTask {
/**
* 检查是否有同设备的任务
*
* @param dto
* @return
*/
@@ -515,6 +523,7 @@ public class AutoCallAirShaftTask {
/**
* 检查是否有同母卷,不同组的点位数据
*
* @param dto
* @return
*/

View File

@@ -226,6 +226,7 @@ public class SlitterServiceImpl implements SlitterService {
@Transactional(rollbackFor = Exception.class)
public JSONObject acsFinishLoadShaft(JSONObject param) {
log.info("ACS申请套管完成参数: {}", param);
String msg = "";
JSONObject res = new JSONObject();
// 穿拔轴位
String deviceCode = param.getString("device_code");
@@ -301,8 +302,10 @@ public class SlitterServiceImpl implements SlitterService {
for (PdmBiSlittingproductionplan plan : plans) {
if (SlitterConstant.SLITTER_SUB_VOLUME_LEFT.equals(plan.getLeft_or_right())) {
plan.setPaper_weight(weight1);
msg = msg + "子卷号:" + plan.getContainer_name() + "的纸管重量: " + weight1 + " | ";
} else {
plan.setPaper_weight(weight2);
msg = msg + "子卷号:" + plan.getContainer_name() + "的纸管重量: " + weight2 + " | ";
}
TaskUtils.updateOptMessageBySlitterPlan(plan);
}
@@ -368,6 +371,7 @@ public class SlitterServiceImpl implements SlitterService {
}
res.put("status", HttpStatus.HTTP_OK);
res.put("message", "请求成功");
res.put("msg", msg);
return res;
}