From 565a15d8ff62202a9633df869921e5ceca40bdab Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Mon, 13 Apr 2026 17:04:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E5=8D=95tplink=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=EF=BC=88=E9=9D=9E=E6=9C=80=E7=BB=88=E7=89=88?= =?UTF-8?q?=E6=9C=AC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nu/entity/IotOptLogEntity.java | 94 ++++++ .../nu/modules/log/api/TplinkOptLogApi.java | 7 + .../camera/service/ICameraInfoJobService.java | 32 ++ .../camera/service/ICameraInfoService.java | 1 + .../impl/CameraInfoJobServiceImpl.java | 275 ++++++++++++++++++ .../service/impl/CameraInfoServiceImpl.java | 99 ++++--- .../log/controller/IotOptLogController.java | 180 ++++++++++++ .../modules/tplink/log/entity/IotOptLog.java | 158 ++++++++++ .../tplink/log/mapper/IotOptLogMapper.java | 17 ++ .../tplink/log/mapper/xml/IotOptLogMapper.xml | 5 + .../tplink/log/service/IIotOptLogService.java | 14 + .../service/impl/IotOptLogServiceImpl.java | 28 ++ .../order/job/DirectiveOrderEndTplinkJob.java | 128 ++++++++ .../order/mapper/DirectiveOrderMapper.java | 9 + .../order/mapper/xml/DirectiveOrderMapper.xml | 28 +- .../service/IDirectiveOrderJobService.java | 26 ++ .../impl/DirectiveOrderJobServiceImpl.java | 42 +++ 17 files changed, 1093 insertions(+), 50 deletions(-) create mode 100644 nursing-unit-common/src/main/java/com/nu/entity/IotOptLogEntity.java create mode 100644 nursing-unit-iot/nu-iot-api/nu-iot-local-api/src/main/java/com/nu/modules/log/api/TplinkOptLogApi.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoJobService.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoJobServiceImpl.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/controller/IotOptLogController.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/entity/IotOptLog.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/IotOptLogMapper.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/xml/IotOptLogMapper.xml create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/IIotOptLogService.java create mode 100644 nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/impl/IotOptLogServiceImpl.java create mode 100644 nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/job/DirectiveOrderEndTplinkJob.java create mode 100644 nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/IDirectiveOrderJobService.java create mode 100644 nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/impl/DirectiveOrderJobServiceImpl.java diff --git a/nursing-unit-common/src/main/java/com/nu/entity/IotOptLogEntity.java b/nursing-unit-common/src/main/java/com/nu/entity/IotOptLogEntity.java new file mode 100644 index 00000000..70184e84 --- /dev/null +++ b/nursing-unit-common/src/main/java/com/nu/entity/IotOptLogEntity.java @@ -0,0 +1,94 @@ +package com.nu.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: tplink操作日志 + * @Author: jeecg-boot + * @Date: 2026-04-09 + * @Version: V1.0 + */ +@Data +public class IotOptLogEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + /** + * 创建人 + */ + private String createBy; + /** + * 创建日期 + */ + private Date createTime; + /** + * 更新人 + */ + private String updateBy; + /** + * 更新日期 + */ + private Date updateTime; + /** + * 设备标识 + */ + private String sn; + /** + * 区域编码 + */ + private String nuId; + /** + * 操作时间 + */ + private Date optTime; + /** + * 操作人 + */ + private String optBy; + /** + * 操作的事件描述 + */ + private String optDesc; + /** + * 操作结果(代码层面,非tplink接口调用结果) + */ + private String optResult; + /** + * tplink接口调用结果 + */ + private String tplinkApiResult; + /** + * 回放视频ftp上传进度查询返回的错误信息 + */ + private String tplinkApiErrorMsg; + /** + * 服务工单id nu_biz_directive_order.id + */ + private String servOrderId; + /** + * tplink任务taskId + */ + private String taskId; + /** + * 上传回放视频的视频开始时间(工单员工点击开始时间) + */ + private Date mp4EmpStartTime; + /** + * 上传回放视频的视频结束时间(工单员工点击结束时间) + */ + private Date mp4EmpEndTime; + /** + * 上传回放视频的视频总分钟数(工单执行时长) + */ + private Integer mp4Minute; + /** + * tplink接口调用传参 + */ + private String tplinkParams; +} diff --git a/nursing-unit-iot/nu-iot-api/nu-iot-local-api/src/main/java/com/nu/modules/log/api/TplinkOptLogApi.java b/nursing-unit-iot/nu-iot-api/nu-iot-local-api/src/main/java/com/nu/modules/log/api/TplinkOptLogApi.java new file mode 100644 index 00000000..e675fb26 --- /dev/null +++ b/nursing-unit-iot/nu-iot-api/nu-iot-local-api/src/main/java/com/nu/modules/log/api/TplinkOptLogApi.java @@ -0,0 +1,7 @@ +package com.nu.modules.log.api; + +import com.nu.entity.IotOptLogEntity; + +public interface TplinkOptLogApi { + int saveData(IotOptLogEntity iotOptLog); +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoJobService.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoJobService.java new file mode 100644 index 00000000..6d1148ee --- /dev/null +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoJobService.java @@ -0,0 +1,32 @@ +package com.nu.modules.tplink.camera.service; + +import cn.hutool.json.JSONObject; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.nu.entity.DirectiveOrderEntity; +import com.nu.modules.tplink.camera.entity.CameraInfo; +import com.nu.modules.tplink.camera.model.CameraTreeModel; +import org.jeecg.common.api.vo.Result; + +import java.util.List; +import java.util.Map; + +/** + * @Description: 护理单元-物联管理-摄像头信息 + * @Author: jeecg-boot + * @Date: 2025-01-17 + * @Version: V1.0 + */ +public interface ICameraInfoJobService extends IService { + + Map getUploadToServerProcess(String taskId); + + /** + * 下载tplink自定义录像 + * + * @return + */ + Map zdyTplinkVideo(DirectiveOrderEntity orderEntity, String orgCode); + +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoService.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoService.java index 2b4e5001..5f5b997f 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoService.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/ICameraInfoService.java @@ -3,6 +3,7 @@ package com.nu.modules.tplink.camera.service; import cn.hutool.json.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.nu.entity.DirectiveOrderEntity; import com.nu.modules.tplink.camera.model.CameraTreeModel; import org.jeecg.common.api.vo.Result; import com.nu.modules.tplink.camera.entity.CameraInfo; diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoJobServiceImpl.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoJobServiceImpl.java new file mode 100644 index 00000000..a678fcca --- /dev/null +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoJobServiceImpl.java @@ -0,0 +1,275 @@ +package com.nu.modules.tplink.camera.service.impl; + +import cn.hutool.json.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.google.common.collect.Maps; +import com.nu.entity.DirectiveOrderEntity; +import com.nu.modules.tplink.camera.entity.CameraInfo; +import com.nu.modules.tplink.camera.mapper.CameraInfoMapper; +import com.nu.modules.tplink.camera.service.ICameraInfoJobService; +import com.nu.modules.tplink.common.entity.ErrorCode; +import com.nu.modules.tplink.common.entity.TumsConfig; +import com.nu.modules.tplink.common.mapper.TumsConfigMapper; +import com.nu.modules.tplink.common.service.IErrorCodeService; +import com.nu.modules.tplink.utils.TumsApi; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.jeecg.common.util.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.io.File; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * @Description: 护理单元-物联管理-摄像头信息 + * @Author: jeecg-boot + * @Date: 2025-01-17 + * @Version: V1.0 + */ +@Service +@Slf4j +public class CameraInfoJobServiceImpl extends ServiceImpl implements ICameraInfoJobService { + + @Autowired + private TumsApi tumsApi; + @Autowired + private IErrorCodeService errorCodeService; + @Autowired + private TumsConfigMapper tumsConfigMapper; + + @Value(value = "${jeecg.path.upload}") + private String uploadpath; + + + /** + * 获取转存MP4上传任务进度 + * + * @return + */ + @Override + public Map getUploadToServerProcess(String taskId) { + Map resultMap = Maps.newHashMap(); + StringBuffer sb = new StringBuffer(); + sb.append("{"); + sb.append("\"taskId\"").append(":").append("\"").append(taskId).append("\""); + sb.append("}"); + String res = tumsApi.getUploadToServerProcess(sb.toString()); + JSONObject jsonObject = new JSONObject(res); + String errorCode = jsonObject.getStr("error_code"); + String url = jsonObject.getStr("url"); + System.out.println("↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓"); + System.out.println(url); + System.out.println("↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑"); + if (errorCode.equals("0")) { + JSONObject result = jsonObject.getJSONObject("result"); + String process = result.getStr("process"); + resultMap.put("result", "success"); + resultMap.put("process", process); + return resultMap; + } else { + String errMsg = jsonObject.getStr("msg"); + if (errMsg == null || errMsg.equals("")) { + try { + ErrorCode errorVo = errorCodeService.getByCode(errorCode); + errMsg = errorVo.getErrorMsg(); + } catch (Exception e) { + errMsg = errorCode; + } + } + log.info("getUploadToServerProcess:{}-{}", errorCode, errMsg); + resultMap.put("result", "error"); + resultMap.put("errorCode", errorCode); + resultMap.put("errMsg", errMsg); + return resultMap; + } + } + + + /** + * 下载tplink自定义录像 + * + * @return + */ + @Override + public Map zdyTplinkVideo(DirectiveOrderEntity orderEntity, String orgCode) { + String nuId = orderEntity.getNuId(); + String startTime = DateUtils.formatDate(orderEntity.getEmpStartTime(), "yyyy-MM-dd HH:mm:ss"); + String endTime = DateUtils.formatDate(orderEntity.getEmpEndTime(), "yyyy-MM-dd HH:mm:ss"); + + Map result = Maps.newHashMap(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("nu_id", nuId); + List tplinkList = baseMapper.selectList(queryWrapper); + if (tplinkList.size() == 0) { + result.put("result", "error"); + return result; + } + String fileName = nuId + "-" + DateUtils.formatDate(new Date(), "yyyyMMddHHmmss" + "-" + orderEntity.getId()); + String year = DateUtils.formatDate(new Date(), "yyyy"); + String month = DateUtils.formatDate(new Date(), "MM"); + String day = DateUtils.formatDate(new Date(), "dd"); + CameraInfo tplinkInfo = tplinkList.get(0); + CameraInfo cameraInfo = new CameraInfo(); + cameraInfo.setDeviceIndex(tplinkInfo.getDeviceIndex()); + cameraInfo.setParentId(tplinkInfo.getParentId()); + cameraInfo.setFileName(fileName); + cameraInfo.setVideoType("1"); + cameraInfo.setFtpUploadpath("/tplinkVideo/fwzl" + "/" + orgCode + + "/" + year + "/" + month + "/" + day + + "/" + orderEntity.getInstructionName() + "/" + orderEntity.getCategoryName() + + "/" + orderEntity.getTypeName() + "/" + orderEntity.getDirectiveName()); + cameraInfo.setStartTime(startTime); + cameraInfo.setEndTime(endTime); + try { + result = uploadToServerResult(cameraInfo); +// result.put("") + return result; + } catch (Exception e) { + e.printStackTrace(); + result.put("result", "error"); + return result; + } + } + + /** + * 回放视频转mp4上传 + * + * @param cameraInfo + * @return + */ + public Map uploadToServerResult(CameraInfo cameraInfo) throws ParseException { + String ftpUsername = ""; + String ftpPassword = ""; + String ftpUploadpath = ""; + String ftpIp = ""; + String ftpPort = ""; + log.info("uploadToServerResult - cameraInfo:{}:", cameraInfo); + CameraInfo entity = baseMapper.getByDeviceId(cameraInfo); + if (entity.getFtpIp() != null && !entity.getFtpIp().equals("")) { + ftpIp = entity.getFtpIp(); + ftpPort = entity.getFtpPort(); + ftpUsername = entity.getFtpUsername(); + ftpPassword = entity.getFtpPassword(); + ftpUploadpath = entity.getFtpUploadpath(); + } else { + TumsConfig tumsConfig = tumsConfigMapper.getByCode(); + ftpIp = tumsConfig.getFtpIp(); + ftpPort = tumsConfig.getFtpPort(); + ftpUsername = tumsConfig.getFtpUsername(); + ftpPassword = tumsConfig.getFtpPassword(); + ftpUploadpath = tumsConfig.getFtpUploadpath(); + } + if (StringUtils.isNotBlank(cameraInfo.getFtpUploadpath())) { + ftpUploadpath = cameraInfo.getFtpUploadpath(); + } + //文件夹不存在就创建 + mkdirsFolder(ftpUploadpath); + String deviceIndex = cameraInfo.getDeviceIndex(); + String parentId = cameraInfo.getParentId(); + String fileName = cameraInfo.getFileName(); + StringBuffer sb = new StringBuffer(); + sb.append("{"); + sb.append("\"videoDevId\"").append(":").append("\"").append(deviceIndex).append("\","); + if (parentId != null && !parentId.equals("") && !parentId.equals("0")) { + //存储设备ID + sb.append("\"storageDevId\"").append(":").append("\"").append(parentId).append("\","); + } else { + //SK卡,取自身设备ID + sb.append("\"storageDevId\"").append(":").append("\"").append(deviceIndex).append("\","); + } + sb.append("\"videoType\"").append(":").append(cameraInfo.getVideoType()).append(","); + sb.append("\"storageType\"").append(":").append("0").append(","); + if (fileName != null && !fileName.equals("")) { + //存储设备ID + sb.append("\"fileName\"").append(":").append("\"").append(fileName).append("\","); + } + // 使用 SimpleDateFormat 解析 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = sdf.parse(cameraInfo.getStartTime()); + Date date2 = sdf.parse(cameraInfo.getEndTime()); + long startTime = date.getTime() / 1000; + long endTime = date2.getTime() / 1000; +// long startTime = 1765993096; +// long endTime = 1765993156; + sb.append("\"startTime\"").append(":").append(startTime).append(","); + sb.append("\"endTime\"").append(":").append(endTime).append(","); + sb.append("\"downloadInfo\"").append(":{"); + sb.append("\"username\"").append(":").append("\"").append(ftpUsername).append("\","); + sb.append("\"password\"").append(":").append("\"").append(ftpPassword).append("\","); + sb.append("\"path\"").append(":").append("\"").append(ftpUploadpath).append("\","); + sb.append("\"ftpIp\"").append(":").append("\"").append(ftpIp).append("\","); + sb.append("\"ftpPort\"").append(":").append(ftpPort); + sb.append("}"); + sb.append("}"); + System.out.println("------------------" + sb.toString()); + String res = tumsApi.uploadToServer(sb.toString()); + JSONObject jsonObject = new JSONObject(res); + String errorCode = jsonObject.getStr("error_code"); + Map resultMap = Maps.newHashMap(); + if (errorCode.equals("0")) { + JSONObject result = jsonObject.getJSONObject("result"); + String taskId = result.getStr("taskId"); + cameraInfo.setTaskId(taskId); +// getUploadToServerProcess(cameraInfo); + resultMap.put("result", "success"); + resultMap.put("taskId", taskId); + resultMap.put("fileName", ftpUploadpath + "/" + fileName + ".mp4"); + return resultMap; + } else { + String errorMsg = ""; + try { + ErrorCode errorVo = errorCodeService.getByCode(errorCode); + errorMsg = errorVo.getErrorMsg(); + } catch (Exception e) { + errorMsg = errorCode; + } + log.info("uploadToServerResult:{}-{}", errorCode, errorMsg); + resultMap.put("result", "error"); + resultMap.put("errorCode", errorCode); + resultMap.put("errorMsg", errorMsg); + return resultMap; + } + } + + public String mkdirsFolder(String folderPath) { + // 创建File对象 + File folder = new File(folderPath); + String ctxPath = uploadpath; + String fileName = null; + File file = new File(ctxPath + File.separator + File.separator); + if (!file.exists()) { + file.mkdirs();// 创建文件根目录 + } // 判断文件夹是否存在 + if (!folder.exists()) { + System.out.println("文件夹不存在,开始创建..."); + + // 创建文件夹(包括所有不存在的父文件夹) + boolean created = folder.mkdirs(); + + if (created) { + System.out.println("文件夹创建成功:" + folderPath); + } else { + System.out.println("文件夹创建失败:" + folderPath); + } + } else { + System.out.println("文件夹已存在:" + folderPath); + + // 还可以判断是否是文件夹而不是文件 + if (folder.isDirectory()) { + System.out.println("这是一个文件夹"); + } else { + System.out.println("这不是一个文件夹,而是文件"); + } + } + return "success"; + } + + +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoServiceImpl.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoServiceImpl.java index dc6c723b..b0eacb38 100644 --- a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoServiceImpl.java +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/camera/service/impl/CameraInfoServiceImpl.java @@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.Maps; +import com.nu.entity.DirectiveOrderEntity; import com.nu.modules.camerainfo.api.CameraInfoApi; import com.nu.entity.CameraInfoEntity; import com.nu.modules.tplink.camera.model.CameraTreeModel; @@ -406,11 +408,12 @@ public class CameraInfoServiceImpl extends ServiceImpl getDeviceDetails(CameraInfo ci){ + public Result getDeviceDetails(CameraInfo ci) { String id = ci.getDeviceIndex(); StringBuffer paramsSb = new StringBuffer(); paramsSb.append("{"); @@ -418,8 +421,8 @@ public class CameraInfoServiceImpl extends ServiceImpl getImageSwitch(Map map){ + public Result getImageSwitch(Map map) { String id = map.get("deviceIndex").toString(); String type = map.get("type").toString(); CameraInfo cameraInfo = new CameraInfo(); cameraInfo.setDeviceIndex(id); cameraInfo = baseMapper.getByDeviceId(cameraInfo); String parentId = cameraInfo.getParentId(); - if(!parentId.equals("0")){ + if (!parentId.equals("0")) { id = parentId; - type = "chn"+cameraInfo.getChannel()+"_switch"; + type = "chn" + cameraInfo.getChannel() + "_switch"; } StringBuffer sb = new StringBuffer(); sb.append("{"); @@ -602,37 +605,37 @@ public class CameraInfoServiceImpl extends ServiceImpl map){ + public Result setImageSwitch(Map map) { String id = map.get("deviceIndex").toString(); String type = map.get("type").toString(); CameraInfo cameraInfo = new CameraInfo(); cameraInfo.setDeviceIndex(id); cameraInfo = baseMapper.getByDeviceId(cameraInfo); String parentId = cameraInfo.getParentId(); - if(!parentId.equals("0")){ + if (!parentId.equals("0")) { id = parentId; - type = "chn"+cameraInfo.getChannel()+"_switch"; + type = "chn" + cameraInfo.getChannel() + "_switch"; } - Map paramMap = (Map)map.get("param"); + Map paramMap = (Map) map.get("param"); StringBuffer sb = new StringBuffer(); sb.append("{"); sb.append("\"devId\"").append(":").append("\"").append(id).append("\"").append(","); @@ -673,8 +676,8 @@ public class CameraInfoServiceImpl extends ServiceImpl0){ - cstr = cstr.substring(0,cstr.length()-1); + if (cstr.length() > 0) { + cstr = cstr.substring(0, cstr.length() - 1); } sb.append(cstr); sb.append("}"); @@ -684,34 +687,34 @@ public class CameraInfoServiceImpl extends ServiceImpl result = Maps.newHashMap(); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("nu_id", nuId); List tplinkList = baseMapper.selectList(queryWrapper); @@ -3132,11 +3136,10 @@ public class CameraInfoServiceImpl extends ServiceImpl { + @Autowired + private IIotOptLogService iotOptLogService; + + /** + * 分页列表查询 + * + * @param iotOptLog + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "tplink操作日志-分页列表查询") + @ApiOperation(value="tplink操作日志-分页列表查询", notes="tplink操作日志-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(IotOptLog iotOptLog, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(iotOptLog, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = iotOptLogService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param iotOptLog + * @return + */ + @AutoLog(value = "tplink操作日志-添加") + @ApiOperation(value="tplink操作日志-添加", notes="tplink操作日志-添加") + @RequiresPermissions("tplink.log:nu_iot_opt_log:add") + @PostMapping(value = "/add") + public Result add(@RequestBody IotOptLog iotOptLog) { + iotOptLogService.save(iotOptLog); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param iotOptLog + * @return + */ + @AutoLog(value = "tplink操作日志-编辑") + @ApiOperation(value="tplink操作日志-编辑", notes="tplink操作日志-编辑") + @RequiresPermissions("tplink.log:nu_iot_opt_log:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody IotOptLog iotOptLog) { + iotOptLogService.updateById(iotOptLog); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "tplink操作日志-通过id删除") + @ApiOperation(value="tplink操作日志-通过id删除", notes="tplink操作日志-通过id删除") + @RequiresPermissions("tplink.log:nu_iot_opt_log:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + iotOptLogService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "tplink操作日志-批量删除") + @ApiOperation(value="tplink操作日志-批量删除", notes="tplink操作日志-批量删除") + @RequiresPermissions("tplink.log:nu_iot_opt_log:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.iotOptLogService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "tplink操作日志-通过id查询") + @ApiOperation(value="tplink操作日志-通过id查询", notes="tplink操作日志-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + IotOptLog iotOptLog = iotOptLogService.getById(id); + if(iotOptLog==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(iotOptLog); + } + + /** + * 导出excel + * + * @param request + * @param iotOptLog + */ + @RequiresPermissions("tplink.log:nu_iot_opt_log:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, IotOptLog iotOptLog) { + return super.exportXls(request, iotOptLog, IotOptLog.class, "tplink操作日志"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("tplink.log:nu_iot_opt_log:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, IotOptLog.class); + } + +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/entity/IotOptLog.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/entity/IotOptLog.java new file mode 100644 index 00000000..485bba66 --- /dev/null +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/entity/IotOptLog.java @@ -0,0 +1,158 @@ +package com.nu.modules.tplink.log.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: tplink操作日志 + * @Author: jeecg-boot + * @Date: 2026-04-09 + * @Version: V1.0 + */ +@Data +@TableName("nu_iot_opt_log") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value = "nu_iot_opt_log对象", description = "tplink操作日志") +public class IotOptLog implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * id + */ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private java.lang.String id; + /** + * 创建人 + */ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /** + * 创建日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /** + * 更新人 + */ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /** + * 更新日期 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /** + * 设备标识 + */ + @Excel(name = "设备标识", width = 15) + @ApiModelProperty(value = "设备标识") + private java.lang.String sn; + /** + * 区域编码 + */ + @Excel(name = "区域编码", width = 15) + @ApiModelProperty(value = "区域编码") + private java.lang.String nuId; + /** + * 操作时间 + */ + @Excel(name = "操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "操作时间") + private java.util.Date optTime; + /** + * 操作人 + */ + @Excel(name = "操作人", width = 15) + @ApiModelProperty(value = "操作人") + private java.lang.String optBy; + /** + * 操作的事件描述 + */ + @Excel(name = "操作的事件描述", width = 15) + @ApiModelProperty(value = "操作的事件描述") + private java.lang.String optDesc; + /** + * 操作结果(代码层面,非tplink接口调用结果) + */ + @Excel(name = "操作结果(代码层面,非tplink接口调用结果)", width = 15) + @ApiModelProperty(value = "操作结果(代码层面,非tplink接口调用结果)") + private java.lang.String optResult; + /** + * tplink接口调用结果 + */ + @Excel(name = "tplink接口调用结果", width = 15) + @ApiModelProperty(value = "tplink接口调用结果") + private java.lang.String tplinkApiResult; + /** + * 回放视频ftp上传进度查询返回的错误信息 + */ + @Excel(name = "回放视频ftp上传进度查询返回的错误信息", width = 15) + @ApiModelProperty(value = "回放视频ftp上传进度查询返回的错误信息") + private java.lang.String tplinkApiErrorMsg; + /** + * 服务工单id nu_biz_directive_order.id + */ + @Excel(name = "服务工单id nu_biz_directive_order.id", width = 15) + @ApiModelProperty(value = "服务工单id nu_biz_directive_order.id") + private java.lang.String servOrderId; + /** + * tplink任务taskId + */ + @Excel(name = "tplink任务taskId", width = 15) + @ApiModelProperty(value = "tplink任务taskId") + private java.lang.String taskId; + /** + * 上传回放视频的视频开始时间(工单员工点击开始时间) + */ + @Excel(name = "上传回放视频的视频开始时间(工单员工点击开始时间)", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "上传回放视频的视频开始时间(工单员工点击开始时间)") + private java.util.Date mp4EmpStartTime; + /** + * 上传回放视频的视频结束时间(工单员工点击结束时间) + */ + @Excel(name = "上传回放视频的视频结束时间(工单员工点击结束时间)", width = 20, format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "上传回放视频的视频结束时间(工单员工点击结束时间)") + private java.util.Date mp4EmpEndTime; + /** + * 上传回放视频的视频总分钟数(工单执行时长) + */ + @Excel(name = "上传回放视频的视频总分钟数(工单执行时长)", width = 15) + @ApiModelProperty(value = "上传回放视频的视频总分钟数(工单执行时长)") + private java.lang.Integer mp4Minute; + /** + * tplink接口调用传参 + */ + @Excel(name = "tplink接口调用传参", width = 15) + @ApiModelProperty(value = "tplink接口调用传参") + private java.lang.String tplinkParams; +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/IotOptLogMapper.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/IotOptLogMapper.java new file mode 100644 index 00000000..5bafaebe --- /dev/null +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/IotOptLogMapper.java @@ -0,0 +1,17 @@ +package com.nu.modules.tplink.log.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import com.nu.modules.tplink.log.entity.IotOptLog; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: tplink操作日志 + * @Author: jeecg-boot + * @Date: 2026-04-09 + * @Version: V1.0 + */ +public interface IotOptLogMapper extends BaseMapper { + +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/xml/IotOptLogMapper.xml b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/xml/IotOptLogMapper.xml new file mode 100644 index 00000000..f70082ae --- /dev/null +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/mapper/xml/IotOptLogMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/IIotOptLogService.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/IIotOptLogService.java new file mode 100644 index 00000000..2f8b2450 --- /dev/null +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/IIotOptLogService.java @@ -0,0 +1,14 @@ +package com.nu.modules.tplink.log.service; + +import com.nu.modules.tplink.log.entity.IotOptLog; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: tplink操作日志 + * @Author: jeecg-boot + * @Date: 2026-04-09 + * @Version: V1.0 + */ +public interface IIotOptLogService extends IService { + +} diff --git a/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/impl/IotOptLogServiceImpl.java b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/impl/IotOptLogServiceImpl.java new file mode 100644 index 00000000..956e4cde --- /dev/null +++ b/nursing-unit-iot/nu-iot-biz/src/main/java/com/nu/modules/tplink/log/service/impl/IotOptLogServiceImpl.java @@ -0,0 +1,28 @@ +package com.nu.modules.tplink.log.service.impl; + +import com.nu.entity.IotOptLogEntity; +import com.nu.modules.log.api.TplinkOptLogApi; +import com.nu.modules.tplink.log.entity.IotOptLog; +import com.nu.modules.tplink.log.mapper.IotOptLogMapper; +import com.nu.modules.tplink.log.service.IIotOptLogService; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: tplink操作日志 + * @Author: jeecg-boot + * @Date: 2026-04-09 + * @Version: V1.0 + */ +@Service +public class IotOptLogServiceImpl extends ServiceImpl implements IIotOptLogService, TplinkOptLogApi { + + @Override + public int saveData(IotOptLogEntity iotOptLog) { + IotOptLog saveData = new IotOptLog(); + BeanUtils.copyProperties(iotOptLog, saveData); + return baseMapper.insert(saveData); + } +} diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/job/DirectiveOrderEndTplinkJob.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/job/DirectiveOrderEndTplinkJob.java new file mode 100644 index 00000000..b518b785 --- /dev/null +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/job/DirectiveOrderEndTplinkJob.java @@ -0,0 +1,128 @@ +package com.nu.modules.biz.order.job; + +import com.alibaba.fastjson.JSONObject; +import com.nu.entity.DirectiveOrderEntity; +import com.nu.modules.biz.order.entity.DirectiveOrder; +import com.nu.modules.biz.order.service.IDirectiveOrderJobService; +import com.nu.modules.sysconfig.ISysConfigApi; +import com.nu.modules.tplink.camera.service.ICameraInfoJobService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang.StringUtils; +import org.jeecg.common.system.api.ISysBaseAPI; +import org.jeecg.common.util.DateUtils; +import org.quartz.Job; +import org.quartz.JobExecutionContext; +import org.quartz.JobExecutionException; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; +import java.util.Map; + +/** + * 指令工单结束后,tplink上传相关处理 + */ +@Slf4j +public class DirectiveOrderEndTplinkJob implements Job { + + + @Autowired + private IDirectiveOrderJobService directiveOrderService; + @Autowired + private ICameraInfoJobService tplinkService; + @Autowired + private ISysConfigApi sysConfigApi; + @Autowired + private ISysBaseAPI sysBaseAPI; + + /** + * tplink进度查询 + tplink上传任务 + *

+ * tplink上传任务 需要依赖 tplink进度查询 所以有先后顺序的 不要把两个任务分贝开线程处理 + * + * @param jobExecutionContext + * @throws JobExecutionException + */ + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { + log.info("OrdersJob:{}-{}", DateUtils.now(), "服务指令结束工单tplink处理定时任务"); + + //机构编码 + JSONObject deptInfo = sysBaseAPI.getDeptInfo(); + String orgCode = deptInfo.getString("code"); + //任务一:查询tplink上传进度 + try { + //查询工单未结束 有任务ID的(上传成功失败都把taskId 则表中有taskId的数据 就都是上传中的了 ) + List directiveOrderList = directiveOrderService.getUploadingTplink(); + directiveOrderList.forEach(order -> { + //todo 上传成功失败都把taskId 则表中有 taskId的数据 就都是上传中的了 + Map tplinkProcessMap = tplinkService.getUploadToServerProcess(order.getTplinkTaskId()); + if ("success".equals((String) tplinkProcessMap.get("result"))) { + String processStr = (String) tplinkProcessMap.get("process"); + int process = Integer.parseInt(processStr); + if (process == 1000) { + // directiveOrderService.finishTplinkUp(order.getId()); + } else { + // directiveOrderService.upTplinkUpProcess(order.getId(), process); + } + System.out.println("===============成功成功成功======================="); + System.out.println("taskId:" + order.getTplinkTaskId()); + System.out.println("进度:" + process); + System.out.println("===============成功成功成功======================="); + } else { + System.out.println("===============失败失败失败======================="); + System.out.println("taskId:" + order.getTplinkTaskId()); + System.out.println("===============失败失败失败======================="); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + + + //任务二:处理tplink上传 + { + //如果未配置,最多重试3次 + Integer tplinkMaxRetries = 3; + JSONObject opeOpenUrl = sysConfigApi.getByKey("tplink_max_retries"); + try { + tplinkMaxRetries = opeOpenUrl.getInteger("configValue"); + } catch (Exception e) { + e.printStackTrace(); + } + + //获取需要处理的工单数据 员工已结束服务 但工单未结束 + List directiveOrderList = directiveOrderService.getNeedProcessTpLinkList(tplinkMaxRetries); + + for (DirectiveOrder directiveOrder : directiveOrderList) { + try { + String nuId = directiveOrder.getNuId(); + String startTime = DateUtils.formatDate(directiveOrder.getEmpStartTime(), "yyyy-MM-dd HH:mm:ss"); + String endTime = DateUtils.formatDate(directiveOrder.getEmpEndTime(), "yyyy-MM-dd HH:mm:ss"); + log.info("nuId:{}", nuId); + log.info("startTime:{}", startTime); + log.info("endTime:{}", endTime); + DirectiveOrderEntity orderEntity = new DirectiveOrderEntity(); + BeanUtils.copyProperties(directiveOrder, orderEntity); + Map resultTplink = tplinkService.zdyTplinkVideo(orderEntity, orgCode); + String tplinkDownCount = directiveOrder.getTplinkDownCount(); + //设置处理次数 + if (StringUtils.isBlank(tplinkDownCount)) { + directiveOrder.setTplinkDownCount("1"); + } else { + directiveOrder.setTplinkDownCount((Integer.parseInt(tplinkDownCount) + 1) + ""); + } + if (!StringUtils.equals("error", (String) resultTplink.get("result"))) { + //成功调用tplink API 开始上传tplink切片 至 目标服务器 + String taskId = (String) resultTplink.get("taskId"); + String fileName = (String) resultTplink.get("fileName"); + directiveOrder.setTplinkTaskId(taskId); + directiveOrder.setTplinkPath(fileName); + } + directiveOrderService.updateById(directiveOrder); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + } +} diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/DirectiveOrderMapper.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/DirectiveOrderMapper.java index 2b7743a2..3d2a54d1 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/DirectiveOrderMapper.java +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/DirectiveOrderMapper.java @@ -53,5 +53,14 @@ public interface DirectiveOrderMapper extends BaseMapper { List queryServOrderList(@Param("entity") DirectiveOrderEntity entity); DirectiveOrderEntity queryOrderNeedDirectiveInfo(@Param("dto") DirectiveOrderEntity entity); + DirectiveOrderEntity queryOrderNeedBaseInfo(@Param("dto") DirectiveOrderEntity entity); + + List getNeedProcessTpLinkList(@Param("tplinkMaxRetries") Integer tplinkMaxRetries); + + List getUploadingTplink(); + + int finishTplinkUp(@Param("id") String id); + + int upTplinkUpProcess(@Param("id") String id, @Param("process") int process); } diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/xml/DirectiveOrderMapper.xml b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/xml/DirectiveOrderMapper.xml index bc0efb0e..1b03965e 100644 --- a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/xml/DirectiveOrderMapper.xml +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/mapper/xml/DirectiveOrderMapper.xml @@ -645,7 +645,7 @@ dire.mp3_file, dire.mp4_file FROM nu_biz_directive_order t - INNER JOIN (SELECT DISTINCT sub.serv_start_time,sub.instruction_id + INNER JOIN (SELECT DISTINCT sub.serv_start_time, sub.instruction_id FROM nu_biz_directive_order sub WHERE sub.nu_id = #{entity.nuId} AND ( @@ -656,7 +656,8 @@ AND ( (sub.serv_end_time >= NOW() AND sub.emp_end_time IS NULL) OR (sub.emp_start_time IS NOT NULL AND sub.emp_end_time IS NULL) - )) tmp ON t.serv_start_time = tmp.serv_start_time and t.instruction_id = tmp.instruction_id + )) tmp + ON t.serv_start_time = tmp.serv_start_time and t.instruction_id = tmp.instruction_id LEFT JOIN nu_config_service_directive dire on t.directive_id = dire.id where t.nu_id = #{entity.nuId} AND ( @@ -706,4 +707,27 @@ LEFT JOIN nu_biz_elder_info elder ON elder.id = base.elder_id WHERE base.nu_id = #{dto.nuId} + + + + + + update nu_biz_directive_order set order_end_time = now(),tplink_task_id = null,tplink_process = '1000' where id = #{id} + + + + update nu_biz_directive_order set tplink_process = #{process} where id = #{id} + diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/IDirectiveOrderJobService.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/IDirectiveOrderJobService.java new file mode 100644 index 00000000..3c7050f7 --- /dev/null +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/IDirectiveOrderJobService.java @@ -0,0 +1,26 @@ +package com.nu.modules.biz.order.service; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.IService; +import com.nu.modules.biz.order.entity.DirectiveOrder; +import org.jeecg.common.api.vo.Result; + +import java.util.List; +import java.util.Map; + +/** + * @Description: 服务指令工单主表 + * @Author: caolei + * @Date: 2025-11-18 + * @Version: V1.0 + */ +public interface IDirectiveOrderJobService extends IService { + + List getNeedProcessTpLinkList(Integer tplinkMaxRetries); + + List getUploadingTplink(); + + void finishTplinkUp(String id); + + void upTplinkUpProcess(String id, int process); +} diff --git a/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/impl/DirectiveOrderJobServiceImpl.java b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/impl/DirectiveOrderJobServiceImpl.java new file mode 100644 index 00000000..1e12e556 --- /dev/null +++ b/nursing-unit-services/nu-services-biz/src/main/java/com/nu/modules/biz/order/service/impl/DirectiveOrderJobServiceImpl.java @@ -0,0 +1,42 @@ +package com.nu.modules.biz.order.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.nu.modules.biz.order.entity.DirectiveOrder; +import com.nu.modules.biz.order.mapper.DirectiveOrderMapper; +import com.nu.modules.biz.order.service.IDirectiveOrderJobService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Description: 服务指令工单主表 + * @Author: caolei + * @Date: 2025-11-18 + * @Version: V1.0 + */ +@Service +@Slf4j +public class DirectiveOrderJobServiceImpl extends ServiceImpl implements IDirectiveOrderJobService { + + @Override + public List getNeedProcessTpLinkList(Integer tplinkMaxRetries) { + return baseMapper.getNeedProcessTpLinkList(tplinkMaxRetries); + } + + @Override + public List getUploadingTplink() { + return baseMapper.getUploadingTplink(); + } + + @Override + public void finishTplinkUp(String id) { + baseMapper.finishTplinkUp(id); + } + + @Override + public void upTplinkUpProcess(String id, int process) { + baseMapper.upTplinkUpProcess(id, process); + } + +}