Commit c68ac62f by HlQ

[add] 返修设备发货钉钉消息通知添加设备序列号字段

1 parent 7a99f27e
package vion.service.impl;
import cn.dev33.satoken.stp.StpUtil;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor;
import org.dromara.hutool.core.array.ArrayUtil;
import org.dromara.hutool.core.data.id.IdUtil;
import org.dromara.hutool.core.date.DateUtil;
import org.dromara.hutool.core.io.file.FileNameUtil;
import org.dromara.hutool.core.io.file.FileUtil;
import org.dromara.hutool.core.lang.Opt;
import org.dromara.hutool.core.map.MapUtil;
import org.dromara.hutool.core.data.id.IdUtil;
import org.dromara.hutool.core.util.ObjUtil;
import org.dromara.hutool.core.text.StrUtil;
import org.dromara.hutool.core.util.ObjUtil;
import org.dromara.hutool.crypto.SecureUtil;
import com.github.yulichang.base.MPJBaseServiceImpl;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.github.linpeilie.Converter;
import lombok.RequiredArgsConstructor;
import org.dromara.hutool.json.JSONUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
......@@ -32,6 +32,7 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author HlQ
......@@ -126,7 +127,16 @@ public class RepairRecServiceImpl extends MPJBaseServiceImpl<RepairRecMapper, Re
@Override
public Boolean notify(Long id, String userid) {
var repairRec = this.getById(id);
MPJLambdaWrapper<RepairRec> wrapper = new MPJLambdaWrapper<RepairRec>()
.selectAll(RepairRec.class)
.selectCollection(RRepairDevice.class, RepairRecVO::getRepairDeviceList)
.leftJoin(RRepairDevice.class, on -> on.eq(RRepairDevice::getRId, RepairRec::getId).eq(RRepairDevice::getRType, 2))
.eq(SparePart::getId, id);
var repairRecVO = this.selectJoinOne(RepairRecVO.class, wrapper);
var deviceNoStr = Opt.ofEmptyAble(repairRecVO.getRepairDeviceList())
.map(l -> l.stream().map(RRepairDevice::getDeviceNo).collect(Collectors.joining(",")))
.orElse("暂无");
var jsonObj = JSONUtil.ofObj()
.set("agent_id", 2358374016L)
......@@ -138,10 +148,12 @@ public class RepairRecServiceImpl extends MPJBaseServiceImpl<RepairRecMapper, Re
### 返修设备已发货
### 项目名称:{}
### 快递单号:{}
### 设备序列号:{}
### 发货日期:{}
### 发送时间:{}
""", repairRec.getProjectName(), Opt.ofBlankAble(repairRec.getTrackingNumber()).orElse("暂无"),
Opt.ofBlankAble(DateUtil.formatDate(repairRec.getShipDate())).orElse("暂无"), DateUtil.now());
""", repairRecVO.getProjectName(), Opt.ofBlankAble(repairRecVO.getTrackingNumber()).orElse("暂无"),
deviceNoStr,
Opt.ofBlankAble(DateUtil.formatDate(repairRecVO.getShipDate())).orElse("暂无"), DateUtil.now());
content.set("text", text);
msg.set("msgtype", "markdown").set("markdown", content);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!