fix:生箔、送气胀轴

This commit is contained in:
2024-11-01 15:09:47 +08:00
parent 78cc598cf1
commit 73f707671e
7 changed files with 51 additions and 9 deletions

View File

@@ -175,6 +175,8 @@ public class RawFoilPdaServiceImpl implements RawFoilPdaService {
// 收卷辊编码 // 收卷辊编码
String rollCode = param.getString("roll_code"); String rollCode = param.getString("roll_code");
String isCallEmpty = param.getString("is_call_empty"); String isCallEmpty = param.getString("is_call_empty");
String theory_height = param.getString("theory_height");
String productin_qty = param.getString("productin_qty");
// 判断是否存在任务 // 判断是否存在任务
List<SchBaseTask> unFinishTasks = taskService.checkHaveTask(pointCode); List<SchBaseTask> unFinishTasks = taskService.checkHaveTask(pointCode);
// 判断是否存在对应的桁架任务 // 判断是否存在对应的桁架任务
@@ -194,7 +196,8 @@ public class RawFoilPdaServiceImpl implements RawFoilPdaService {
rawOrder.setMfg_order_name("$$$$"); rawOrder.setMfg_order_name("$$$$");
rawOrder.setProduct_name("锂电"); rawOrder.setProduct_name("锂电");
rawOrder.setDescription("锂电"); rawOrder.setDescription("锂电");
rawOrder.setTheory_height(BigDecimal.valueOf(2000)); rawOrder.setTheory_height(new BigDecimal(theory_height));
rawOrder.setProductin_qty(new BigDecimal(productin_qty));
rawOrder.setUp_coiler_date(DateUtil.now()); rawOrder.setUp_coiler_date(DateUtil.now());
rawOrder.setStatus("01"); rawOrder.setStatus("01");
rawOrder.setWind_roll(rollCode); rawOrder.setWind_roll(rollCode);

View File

@@ -399,6 +399,11 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
StIvtCutpointivt cutDevice = cutpointivtService.getPintByUpOrDownCode(pointCode, false); StIvtCutpointivt cutDevice = cutpointivtService.getPintByUpOrDownCode(pointCode, false);
List<PdmBiSlittingproductionplan> plans = new ArrayList<>(); List<PdmBiSlittingproductionplan> plans = new ArrayList<>();
int count = 1; int count = 1;
if (row.size() > 4) {
throw new BadRequestException("一趟最多只能申请4个纸管");
}
// hint: 获取临时搭建母卷号
String virtualContainer = TaskUtils.createVirtualGroupNum("yyMMddHHmmss");
for (CallShaftVo callShaftVo : row) { for (CallShaftVo callShaftVo : row) {
// 保存工单 // 保存工单
PdmBiSlittingproductionplan plan = new PdmBiSlittingproductionplan(); PdmBiSlittingproductionplan plan = new PdmBiSlittingproductionplan();
@@ -406,10 +411,11 @@ public class SlitterPdaServiceImpl implements SlitterPdaService {
plan.setOrder_type("1"); plan.setOrder_type("1");
plan.setContainer_name(TaskUtils.createVirtualSubContainer("yyMMddHHmmss", cutDevice.getExt_code(), count++)); plan.setContainer_name(TaskUtils.createVirtualSubContainer("yyMMddHHmmss", cutDevice.getExt_code(), count++));
plan.setProduct_name("-"); plan.setProduct_name("-");
// plan.setParent_container_name(virtualContainer);
plan.setSplit_group(virtualContainer);
plan.setDescription("-"); plan.setDescription("-");
plan.setWare_house("-"); plan.setWare_house("-");
plan.setResource_name(cutDevice.getExt_code()); plan.setResource_name(cutDevice.getExt_code());
plan.setSplit_group("-");
plan.setManufacture_sort("1"); plan.setManufacture_sort("1");
plan.setMfg_order_name("-"); plan.setMfg_order_name("-");
plan.setManufacture_date(DateUtil.format(new Date(), "yyyy-MM-dd")); plan.setManufacture_date(DateUtil.format(new Date(), "yyyy-MM-dd"));

View File

@@ -10,6 +10,7 @@ import lombok.Data;
@Data @Data
public class CallShaftVo { public class CallShaftVo {
private String point_code; private String point_code;
private String location;
private String left_or_right; private String left_or_right;
private String material_code; private String material_code;
private String material_spec; private String material_spec;

View File

@@ -207,7 +207,7 @@ public class NbjPdaServiceImpl implements NbjPdaService {
// 分切计划校验 // 分切计划校验
JSONArray rows = param.getJSONArray("row"); JSONArray rows = param.getJSONArray("row");
if (rows.size() > 2) { if (rows.size() > 2) {
throw new BadRequestException("一次只能绑定2个分切计划"); throw new BadRequestException("一次最多只能绑定2个分切计划");
} }
List<PdmBiSlittingproductionplan> planList = rows.toJavaList(PdmBiSlittingproductionplan.class); List<PdmBiSlittingproductionplan> planList = rows.toJavaList(PdmBiSlittingproductionplan.class);
List<String> orderIds = planList.stream() List<String> orderIds = planList.stream()
@@ -241,6 +241,14 @@ public class NbjPdaServiceImpl implements NbjPdaService {
tzzcPoint.setPoint_status("2"); tzzcPoint.setPoint_status("2");
setBCutUpdateByPC(tzzcPoint); setBCutUpdateByPC(tzzcPoint);
bstIvtCutpointivtService.updateById(tzzcPoint); bstIvtCutpointivtService.updateById(tzzcPoint);
// 查找同组的另一个气胀轴是否有没套好套好就创建AGV
List<PdmBiSlittingproductionplan> list = slittingproductionplanService.getSameGroupOthers(demoPlan.getSplit_group(), demoPlan.getUp_or_down());
if (CollectionUtil.isEmpty(list)) {
// 创建任务
JSONObject sendParam = new JSONObject();
sendParam.put("point_code", pointCode);
toDoSendShaft(sendParam);
}
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value()); result.put("status", HttpStatus.OK.value());
result.put("message", "管芯绑定成功!"); result.put("message", "管芯绑定成功!");
@@ -381,6 +389,14 @@ public class NbjPdaServiceImpl implements NbjPdaService {
public JSONObject doSendShaft(JSONObject param) { public JSONObject doSendShaft(JSONObject param) {
log.info("手持送气胀轴 - {}", param); log.info("手持送气胀轴 - {}", param);
// param: point_code, device // param: point_code, device
toDoSendShaft(param);
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "送轴任务创建成功!");
return result;
}
private void toDoSendShaft(JSONObject param) {
String pointCode = param.getString("point_code"); String pointCode = param.getString("point_code");
String device = param.getString("device"); String device = param.getString("device");
BstIvtCutpointivt startPoint = bstIvtCutpointivtService.getPintByTrussCode(pointCode, false); BstIvtCutpointivt startPoint = bstIvtCutpointivtService.getPintByTrussCode(pointCode, false);
@@ -430,9 +446,5 @@ public class NbjPdaServiceImpl implements NbjPdaService {
taskParam.put("is_flag", "0"); taskParam.put("is_flag", "0");
} }
pdaSendShaftAGVTask.createTask(taskParam); pdaSendShaftAGVTask.createTask(taskParam);
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "送轴任务创建成功!");
return result;
} }
} }

View File

@@ -145,6 +145,14 @@ public interface IpdmBiSlittingproductionplanService extends IService<PdmBiSlitt
* @return * @return
*/ */
List<PdmBiSlittingproductionplan> getByContainerNames(List<String> collect); List<PdmBiSlittingproductionplan> getByContainerNames(List<String> collect);
/**
* 获取同组, 不同上下
* @param splitGroup 组别
* @param upDown 上下卷
* @return
*/
List<PdmBiSlittingproductionplan> getSameGroupOthers(String splitGroup, String upDown);
} }

View File

@@ -295,5 +295,14 @@ public class PdmBiSlittingproductionplanServiceImpl extends ServiceImpl<PdmBiSli
lam.in(PdmBiSlittingproductionplan::getContainer_name, collect); lam.in(PdmBiSlittingproductionplan::getContainer_name, collect);
return pdmBiSlittingproductionplanMapper.selectList(lam); return pdmBiSlittingproductionplanMapper.selectList(lam);
} }
@Override
public List<PdmBiSlittingproductionplan> getSameGroupOthers(String splitGroup, String upDown) {
LambdaQueryWrapper<PdmBiSlittingproductionplan> lam = new QueryWrapper<PdmBiSlittingproductionplan>().lambda();
lam.eq(PdmBiSlittingproductionplan::getSplit_group, splitGroup)
.ne(PdmBiSlittingproductionplan::getUp_or_down, upDown)
.eq(PdmBiSlittingproductionplan::getIs_child_tz_ok, "0");
return pdmBiSlittingproductionplanMapper.selectList(lam);
}
} }

View File

@@ -331,8 +331,8 @@ public class TaskUtils {
*/ */
public static String createVirtualQzzNo(String resourceName, String format, PdmBiSlittingproductionplan demoPlan) { public static String createVirtualQzzNo(String resourceName, String format, PdmBiSlittingproductionplan demoPlan) {
return resourceName.substring(0, 2) return resourceName.substring(0, 2)
+ resourceName.substring(resourceName.length() - 2) + resourceName.substring(resourceName.length() - 2) + "-"
+ demoPlan.getSplit_group() // + demoPlan.getSplit_group()
+ TaskUtils.getDateTime(format) + "-" + TaskUtils.getDateTime(format) + "-"
+ demoPlan.getUp_or_down(); + demoPlan.getUp_or_down();
} }
@@ -398,6 +398,9 @@ public class TaskUtils {
public static String createVirtualContainer(String rollCode, String format, String pointCode) { public static String createVirtualContainer(String rollCode, String format, String pointCode) {
return "R-" + pointCode + "-" + TaskUtils.getDateTime(format) + "-" + rollCode; return "R-" + pointCode + "-" + TaskUtils.getDateTime(format) + "-" + rollCode;
} }
public static String createVirtualGroupNum(String format) {
return "G" + "-" + TaskUtils.getDateTime(format);
}
/** /**
* 创建虚拟的子卷号 * 创建虚拟的子卷号
* @param format 时间格式 * @param format 时间格式