From 6fb7a3677d31671645ca8e11957aff2685927f13 Mon Sep 17 00:00:00 2001 From: liyongde <1419499670@qq.com> Date: Mon, 9 Oct 2023 09:23:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=89=A9=E6=96=99=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=80=81=E5=88=86=E6=8B=A3=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E8=83=BD=E5=A4=9F=E7=BB=A7=E7=BB=AD=E7=A0=81?= =?UTF-8?q?=E5=9E=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../material/service/dao/MdBaseMaterial.java | 22 +++ .../service/dao/mapper/MesRequestMapper.xml | 24 +++ .../service/dao/vo/AcsWorkOrderVo.java | 3 +- .../nl/wms/sch/task_manage/AbstractTask.java | 15 +- .../task_manage/task/tasks/fj/FJMKTask.java | 152 +++++++++--------- .../task/tasks/fj/mapper/FJMapper.java | 8 + .../task/tasks/fj/mapper/FJMapper.xml | 7 + .../task_manage/task/tasks/hn/HNMLTask.java | 1 - .../task_manage/task/tasks/yz/YZSLTask.java | 7 +- .../main/java/org/nl/wms/util/TaskUtils.java | 17 ++ .../src/main/java/org/nl/wms/util/Tes.java | 29 ++++ .../src/main/resources/config/application.yml | 2 +- 12 files changed, 196 insertions(+), 91 deletions(-) create mode 100644 lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/Tes.java diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/material/service/dao/MdBaseMaterial.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/material/service/dao/MdBaseMaterial.java index e1827b6..0c18abd 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/material/service/dao/MdBaseMaterial.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/database/material/service/dao/MdBaseMaterial.java @@ -104,4 +104,26 @@ public class MdBaseMaterial implements Serializable { @ApiModelProperty(value = "W") private String w_thickness; + private String matsize; + private BigDecimal standing_time_lower; + private BigDecimal standing_time_upper; + private BigDecimal single_weight_upper; + private BigDecimal single_weight_lower; + private BigDecimal standard_size_height1; + private BigDecimal standard_size_height1_lower; + private BigDecimal standard_size_height1_upper; + private BigDecimal standard_size_height2; + private BigDecimal standard_size_height2_lower; + private BigDecimal standard_size_height2_upper; + private BigDecimal standard_size_height3; + private BigDecimal standard_size_height3_upper; + private BigDecimal standard_size_height3_lower; + private BigDecimal standard_size_height4; + private BigDecimal standard_size_height4_lower; + private BigDecimal standard_size_height4_upper; + private BigDecimal cooling_time_lower; + private String pack_palletspec; + private String pack_method; + private String pack_directsize; + private String draw_address; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml index e108afc..b975ffa 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/mes/service/dao/mapper/MesRequestMapper.xml @@ -112,6 +112,30 @@ FORMULA AS raw_material_code, REC_TIM AS ext_time, sysdate AS create_time, + MATSIZE AS matsize, + SLEEP_TIME_NORM AS standing_time, + SLEEP_TIME_LOWER AS standing_time_lower, + SLEEP_TIME_UPPER AS standing_time_upper, + MATCONVERTRATE_LOWER AS single_weight_lower, + MATCONVERTRATE_UPPER AS single_weight_upper, + MATSIZE1_NORM AS standard_size_height1, + MATSIZE1_LOWER AS standard_size_height1_lower, + MATSIZE1_UPPER AS standard_size_height1_upper, + MATSIZE2_NORM AS standard_size_height2, + MATSIZE2_LOWER AS standard_size_height2_lower, + MATSIZE2_UPPER AS standard_size_height2_upper, + MATSIZE3_NORM AS standard_size_height3, + MATSIZE3_LOWER AS standard_size_height3_lower, + MATSIZE3_UPPER AS standard_size_height3_upper, + MATSIZE4_NORM AS standard_size_height4, + MATSIZE4_LOWER AS standard_size_height4_lower, + MATSIZE4_UPPER AS standard_size_height4_upper, + COOL_TIME_NORM AS cooling_time, + COOL_TIME_LOWER AS cooling_time_lower, + PACK_PALLETSPEC AS pack_palletspec, + PACK_METHOD AS pack_method, + PACK_DIRECTSIZE AS pack_directsize, + DRAW_ADDRESS AS draw_address, '3' AS create_id, 'MES系统' AS create_name FROM diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java index 33f6a92..09eef00 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pdm/workorder/service/dao/vo/AcsWorkOrderVo.java @@ -22,11 +22,12 @@ public class AcsWorkOrderVo { private String w; // 宽度 private String size_error; // 尺寸允许误差 private String single_weight; // 单重允许误差 -// private String drawing_address; // 图纸地址 + // private String drawing_address; // 图纸地址 private String standard_size_height1; // 标准尺寸1 private String standard_size_height2; // 标准尺寸2 private String standard_size_height3; // 标准尺寸3 private String standard_size_height4; // 标准尺寸4 private String standard_weight; // 标准重量 private String detection_error; // 检测误差值 - 不用传 + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java index c7bfeef..ec75663 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java @@ -12,9 +12,7 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.nl.common.exception.BadRequestException; import org.nl.wms.ext.acs.service.WmsToAcsService; -import org.nl.wms.ext.acs.service.dto.to.acs.IssueAcsRequest; import org.nl.wms.ext.acs.service.dto.to.wms.AcsResponse; -import org.nl.wms.ext.record.service.ISysInteractRecordService; import org.nl.wms.pdm.workorder.service.IPdmBdWorkorderService; import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder; import org.nl.wms.sch.point.service.ISchBasePointService; @@ -25,18 +23,14 @@ import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum; import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum; -import org.nl.wms.sch.task_manage.task.AcsUtil; import org.nl.wms.sch.task_manage.task.core.TaskStatus; import org.nl.wms.util.TaskUtils; -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.ArrayList; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.TimeUnit; /** * @author ldjun @@ -56,11 +50,7 @@ public abstract class AbstractTask { @Autowired private IPdmBdWorkorderService workorderService; @Autowired - private ISysInteractRecordService interactRecordService; - @Autowired private WmsToAcsService wmsToAcsService; - @Autowired - private RedissonClient redissonClient; /** * 任务创建 @@ -68,6 +58,11 @@ public abstract class AbstractTask { */ protected abstract void create() throws BadRequestException; + /** + * 任务创建 + * 只会创建完整的任务,创建失败则抛出异常 + * @param task + */ protected void createCompletion(SchBaseTask task){} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java index a98bbb9..c0ca643 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/FJMKTask.java @@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.sun.org.apache.regexp.internal.RE; import org.nl.common.exception.BadRequestException; import org.nl.common.utils.CodeUtil; import org.nl.config.MapOf; @@ -80,6 +81,7 @@ public class FJMKTask extends AbstractTask { .collect(Collectors.toList()); String requestParam = task.getRequest_param();// 任务的其他数据 JSONObject jsonObject = JSONObject.parseObject(requestParam); + String workOrderCode = jsonObject.getString("workorder_code"); // 工单 String startPoint = task.getPoint_code1(); // 获取起点 回写载具编码 SchBasePoint startPointObj = pointService.getById(startPoint); @@ -103,51 +105,52 @@ public class FJMKTask extends AbstractTask { for (ApplyDeviceDto applyDeviceDto : list) { sum += Integer.parseInt(applyDeviceDto.getQty()); } - // todo: 需要提供两个托盘上的数量 - // 2.1 获取库存剩余数量 + 2.2 获取在搬运任务 - 组盘绑定状态是带绑定状态、任务类型是创建完成、下发、执行中 + // 2 获取剩余量 surplusNumber + // 2.1 获取库存剩余数量 + 2.2 获取在搬运任务 ( 组盘绑定状态是带绑定状态、任务类型是创建完成、下发、执行中 ) int surplusNumber = fjMapper.getInventoryQuantity(); - int total = sum + surplusNumber; // 现有总数 - // 3 获取木托盘需要多少块 - int needFullNumber = 255; // todo: 具体未知如何获取 - JSONObject response = new JSONObject(); - String responseParam = task.getResponse_param(); - if (ObjectUtil.isNotEmpty(responseParam)) { - response = JSON.parseObject(responseParam); - } + // 3 现有总数 total + int total = sum + surplusNumber; + // 4 获取木托盘需要多少块 needFullNumber + PdmBdWorkorder workorder = workorderService.getByCode(workOrderCode); + String needFullNumberStr = fjMapper.getNeedFullNumber(workorder.getMaterial_id()); + int needFullNumber = TaskUtils.convertMultiply(needFullNumberStr); // 大于两托正常,大于1托给1,小于1托给2 - // 4 校验是否够码满一托/两托 + // 5 校验是否够码满一托/两托 // 大于等于2就可以码 - /** 覆膜机木托盘位 */ - SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject); - if (ObjectUtil.isEmpty(LaminatePoint)) { - task.setRemark("覆膜区不可用!"); - noticeService.createNotice(task.getRemark(), TASK_CONFIG_CODE + task.getTask_code(), - NoticeTypeEnum.WARN.getCode()); - taskService.updateById(task); - // 消息通知 - continue; + if (total/needFullNumber >= 2) { + /** 覆膜机木托盘位 */ + SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject); + if (ObjectUtil.isEmpty(LaminatePoint)) { + noticeService.createNotice("覆膜区不可用!", TASK_CONFIG_CODE + task.getPoint_code1(), + NoticeTypeEnum.WARN.getCode()); + // 消息通知 + throw new BadRequestException("覆膜区不可用!"); + } + // 把这个设备位放到任务中 + JSONObject response = new JSONObject(); + String responseParam = task.getResponse_param(); + if (ObjectUtil.isNotEmpty(responseParam)) { + response = JSON.parseObject(responseParam); + } + response.put("fmj_device", LaminatePoint.getPoint_code()); + // 生产木托盘编码 + // 设置终点并修改创建成功状态 + task.setPoint_code3(LaminatePoint.getParent_point_code()); + task.setPoint_code4(startPoint); + task.setResponse_param(response.toJSONString()); + // 覆膜机对接位上锁 + SchBasePoint basePoint = pointService.getById(LaminatePoint.getParent_point_code()); + basePoint.setIng_task_code(task.getTask_code()); + PointUtils.setUpdateByAcs(basePoint); + pointService.updateById(basePoint); } - // 把这个设备位放到任务中 - response.put("fmj_device", LaminatePoint.getPoint_code()); - // 生产木托盘编码 - // 设置终点并修改创建成功状态 - task.setPoint_code3(LaminatePoint.getParent_point_code()); - task.setPoint_code4(startPoint); task.setTask_status(TaskStatus.CREATED.getCode()); task.setRemark(""); - taskService.updateById(task); - + taskService.save(task); + // 包装线上锁 packagePoint.setIng_task_code(task.getTask_code()); PointUtils.setUpdateByAcs(packagePoint); pointService.updateById(packagePoint); - // 覆膜机对接位 - SchBasePoint basePoint = pointService.getById(LaminatePoint.getParent_point_code()); - basePoint.setIng_task_code(task.getTask_code()); - PointUtils.setUpdateByAcs(basePoint); - pointService.updateById(basePoint); - - //下发 - //this.renotifyAcs(task); } } @@ -164,6 +167,7 @@ public class FJMKTask extends AbstractTask { .collect(Collectors.toList()); String requestParam = task.getRequest_param();// 任务的其他数据 JSONObject jsonObject = JSONObject.parseObject(requestParam); + String workOrderCode = jsonObject.getString("workorder_code"); // 工单 String startPoint = task.getPoint_code1(); // 获取起点 回写载具编码 SchBasePoint startPointObj = pointService.getById(startPoint); @@ -185,51 +189,53 @@ public class FJMKTask extends AbstractTask { for (ApplyDeviceDto applyDeviceDto : list) { sum += Integer.parseInt(applyDeviceDto.getQty()); } - // 2.1 获取库存剩余数量 + 2.2 获取在搬运任务 - 组盘绑定状态是带绑定状态、任务类型是创建完成、下发、执行中 + // 2 获取剩余量 surplusNumber + // 2.1 获取库存剩余数量 + 2.2 获取在搬运任务 ( 组盘绑定状态是带绑定状态、任务类型是创建完成、下发、执行中 ) int surplusNumber = fjMapper.getInventoryQuantity(); - int total = sum + surplusNumber; // 现有总数 - // 3 获取木托盘需要多少块 - int needFullNumber = 255; // todo: 具体未知如何获取 - JSONObject response = new JSONObject(); - String responseParam = task.getResponse_param(); - if (ObjectUtil.isNotEmpty(responseParam)) { - response = JSON.parseObject(responseParam); - } - // 大于两托正常,大于1托给个1,小于1托给2 - // 4 校验是否够码满一托/两托 - if ((total % needFullNumber) == 0) { - // 不可以叫空木托盘 -// response.put("") - } else if ((total % needFullNumber) < 2) { - // 不可以叫空木托盘 - } - // 大于2就可以码 - /** 覆膜机木托盘位 */ - SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject); - if (ObjectUtil.isEmpty(LaminatePoint)) { - noticeService.createNotice("覆膜区不可用!", TASK_CONFIG_CODE + task.getPoint_code1(), - NoticeTypeEnum.WARN.getCode()); - // 消息通知 - throw new BadRequestException("覆膜区不可用!"); + // 3 现有总数 total + int total = sum + surplusNumber; + // 4 获取木托盘需要多少块 needFullNumber + PdmBdWorkorder workorder = workorderService.getByCode(workOrderCode); + String needFullNumberStr = fjMapper.getNeedFullNumber(workorder.getMaterial_id()); + int needFullNumber = TaskUtils.convertMultiply(needFullNumberStr); + // 大于两托正常,大于1托给1,小于1托给2 + // 5 校验是否够码满一托/两托 + // 大于等于2就可以码 + if (total/needFullNumber >= 2) { + /** 覆膜机木托盘位 */ + SchBasePoint LaminatePoint = findStartPoint(startRegionStr, jsonObject); + if (ObjectUtil.isEmpty(LaminatePoint)) { + noticeService.createNotice("覆膜区不可用!", TASK_CONFIG_CODE + task.getPoint_code1(), + NoticeTypeEnum.WARN.getCode()); + // 消息通知 + throw new BadRequestException("覆膜区不可用!"); + } + // 把这个设备位放到任务中 + JSONObject response = new JSONObject(); + String responseParam = task.getResponse_param(); + if (ObjectUtil.isNotEmpty(responseParam)) { + response = JSON.parseObject(responseParam); + } + response.put("fmj_device", LaminatePoint.getPoint_code()); + // 生产木托盘编码 + // 设置终点并修改创建成功状态 + task.setPoint_code3(LaminatePoint.getParent_point_code()); + task.setPoint_code4(startPoint); + task.setResponse_param(response.toJSONString()); + // 覆膜机对接位上锁 + SchBasePoint basePoint = pointService.getById(LaminatePoint.getParent_point_code()); + basePoint.setIng_task_code(task.getTask_code()); + PointUtils.setUpdateByAcs(basePoint); + pointService.updateById(basePoint); } - // 把这个设备位放到任务中 - response.put("fmj_device", LaminatePoint.getPoint_code()); - // 生产木托盘编码 - // 设置终点并修改创建成功状态 - task.setPoint_code3(LaminatePoint.getParent_point_code()); - task.setPoint_code4(startPoint); task.setTask_status(TaskStatus.CREATED.getCode()); task.setRemark(""); taskService.save(task); - + // 包装线上锁 packagePoint.setIng_task_code(task.getTask_code()); PointUtils.setUpdateByAcs(packagePoint); pointService.updateById(packagePoint); - // 覆膜机对接位 - SchBasePoint basePoint = pointService.getById(LaminatePoint.getParent_point_code()); - basePoint.setIng_task_code(task.getTask_code()); - PointUtils.setUpdateByAcs(basePoint); - pointService.updateById(basePoint); + } @Override diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.java index 4009f01..e1dc483 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.java @@ -18,4 +18,12 @@ public interface FJMapper { SchBasePoint findPointForFJQK(List regionCode, @Param("fluentPut") JSONObject fluentPut); int getInventoryQuantity(); + + /** + * 获取满托需要多少块 + * eg: 2*7*6 + * @param materialId + * @return + */ + String getNeedFullNumber(String materialId); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.xml index 7dfc52f..af041fa 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/fj/mapper/FJMapper.xml @@ -60,4 +60,11 @@ ) AND vg.group_bind_material_status = '1' ) + diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java index f8d9ed6..92ccd3e 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/hn/HNMLTask.java @@ -310,7 +310,6 @@ public class HNMLTask extends AbstractTask { String vehicleCode = TaskUtils.defaultVehicleCode(param.getString("vehicle_code")); String vehicleType = param.getString("vehicle_type"); // 泥料物料对应不出物料标识 - // todo: 暂未处理 String packNo = param.getString("material_code"); // 泥料编码: 吨袋号,泥料前 String materialCode = packNo.substring(0, 12); String mixTimes = packNo.substring(18, packNo.length()); // 碾次 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java index 0e97ad7..c38be0c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/task/tasks/yz/YZSLTask.java @@ -308,14 +308,14 @@ public class YZSLTask extends AbstractTask { } public void finishTask(SchBaseTask taskObj, TaskFinishedTypeEnum taskFinishedType) { - String startPoint = taskObj.getPoint_code1(); // 获取起点 String endPoint = taskObj.getPoint_code2(); // 获取终点 - SchBasePoint startPointObj = pointService.getById(startPoint); SchBasePoint endPointObj = pointService.getById(endPoint); if (ObjectUtil.isNotEmpty(endPointObj)) { // 终点解锁 endPointObj.setIng_task_code(""); + // 终点清空 PointUtils.setUpdateByType(endPointObj, taskFinishedType); + PointUtils.clearPointAndRetainNum(endPointObj); pointService.updateById(endPointObj); // 组盘表数据改成已绑定 SchBaseVehiclematerialgroup vehiclematerialgroup = vehiclematerialgroupService.getById(taskObj.getGroup_id()); @@ -342,9 +342,6 @@ public class YZSLTask extends AbstractTask { TaskUtils.setWorkOrderUpdateByType(bdWorkorder, taskFinishedType); workorderService.updateById(bdWorkorder); } - // 起点清空 - PointUtils.setUpdateByType(startPointObj, taskFinishedType); - PointUtils.clearPointAndRetainNum(startPointObj); // 任务完成 taskObj.setTask_status(TaskStatus.FINISHED.getCode()); taskObj.setRemark(GeneralDefinition.TASK_FINISH); diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java index 7cc9359..7e9de35 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/TaskUtils.java @@ -175,4 +175,21 @@ public class TaskUtils { } return String.format("%04d", Integer.parseInt(acsVehicleCode)); } + + /** + * 将输入的字符串相乘得出值 + * eg: 2*7*6 + * return: 84 + * @param needFullNumberStr + * @return + */ + public static int convertMultiply(String needFullNumberStr) { + String[] parts = needFullNumberStr.split("\\*"); // 使用 "*" 来分割字符串 + int result = 1; // 初始化结果为1 + for (String part : parts) { + int number = Integer.parseInt(part); // 将字符串部分解析为整数 + result *= number; // 将解析的整数与结果相乘 + } + return result; + } } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/Tes.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/Tes.java new file mode 100644 index 0000000..78ac359 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/util/Tes.java @@ -0,0 +1,29 @@ +package org.nl.wms.util; + +import java.io.IOException; + +/** + * @Author: lyd + * @Description: + * @Date: 2023/10/8 + */ +public class Tes { + public static void main(String[] args) { + String videoFilePath = "video.mp4"; + String audioFilePath = "audio.wav"; + + String ffmpegCommand = "ffmpeg -i " + videoFilePath + " -vn -acodec pcm_s16le -ar 44100 -ac 2 " + audioFilePath; + + try { + Process process = Runtime.getRuntime().exec(ffmpegCommand); + int exitCode = process.waitFor(); + if (exitCode == 0) { + System.out.println("音频提取完成"); + } else { + System.err.println("音频提取失败"); + } + } catch (IOException | InterruptedException e) { + e.printStackTrace(); + } + } +} diff --git a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml index 7e2aa7b..a37104c 100644 --- a/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml +++ b/lms/nladmin-system/nlsso-server/src/main/resources/config/application.yml @@ -42,7 +42,7 @@ spring: freemarker: check-template-location: false profiles: - active: dev + active: prod jackson: time-zone: GMT+8 data: