1.修复语音文字提醒不显示问题

master
董哲奇 7 months ago
parent 043876f09d
commit eeb5c0bdab

@ -3,6 +3,7 @@ package com.dsic.gj_erp.service.jhgk.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@ -41,6 +42,7 @@ import java.util.stream.Collectors;
* @author xn
* @since 2023-11-09
*/
@SuppressWarnings("ALL")
@Service
public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> implements DmYdjhService {
@ -246,14 +248,9 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
String bzrq= DateUtil.format(DateUtil.date(), "yyyy/MM/dd");
//工单号
List<DmYdjh> updateList = ydjhList.stream().filter(item->StrUtil.isNotEmpty(item.getSljhrq())).map(item -> {
Long increment = redisTemplate.opsForHash().increment("ZYJH_GDH::", item.getSljhrq(), 1);
DmYdjh dmYdjh = new DmYdjh();
dmYdjh.setId(item.getId());
dmYdjh.setZt("2");
dmYdjh.setDjh(StrUtil.format("{}{}",item.getSljhrq().replace("/",""), String.format("%03d",increment)));
return dmYdjh;
}).collect(Collectors.toList());
List<DmYdjh> updateList = ydjhList.stream()
.filter(item->StrUtil.isNotEmpty(item.getSljhrq()))
.map(this::ofXf).collect(Collectors.toList());
this.updateBatchById(updateList);
@ -309,4 +306,24 @@ public class DmYdjhServiceImpl extends ServiceImpl<DmYdjhMapper, DmYdjh> impleme
publisher.publishEvent(ydjhList);
}
private DmYdjh ofXf(DmYdjh item){
Long djh=this.handlerDjh(item);
DmYdjh dmYdjh = new DmYdjh();
dmYdjh.setId(item.getId());
dmYdjh.setZt("2");
String perfix=item.getSljhrq().replace("/","");
perfix=perfix.substring(2);
dmYdjh.setDjh(StrUtil.format("{}{}",perfix, String.format("%03d",djh)));
return dmYdjh;
}
private Long handlerDjh(DmYdjh item){
String key="ZYJH_GDH::";
//从101开始生成工单号,方便工人念出
if (ObjUtil.isEmpty(redisTemplate.opsForHash().get(key, item.getSljhrq()))) {
redisTemplate.opsForHash().put(key, item.getSljhrq(),100);
}
return redisTemplate.opsForHash().increment(key, item.getSljhrq(), 1);
}
}

@ -20,14 +20,15 @@ public class ZxHandler implements IHandlerService{
@Override
public boolean execute(Message message) {
String djh=message.getMsg().getOrderNumber();
DmYdjh one = ydjhService.getOne(Wrappers.<DmYdjh>lambdaQuery().eq(DmYdjh::getDjh, djh));
Optional.ofNullable(one).ifPresent(item->{
JSONObject object=new JSONObject();
object.put("zyjh",one);
object.put("zt",one.getZt());
wsHandler.zyjhzx(object);
});
wsHandler.zyjhzx(message.toJson());
// String djh=message.getMsg().getOrderNumber();
// DmYdjh one = ydjhService.getOne(Wrappers.<DmYdjh>lambdaQuery().eq(DmYdjh::getDjh, djh));
// Optional.ofNullable(one).ifPresent(item->{
// JSONObject object=new JSONObject();
// object.put("zyjh",one);
// object.put("zt",one.getZt());
// wsHandler.zyjhzx(object);
// });
return true;
}
}

Loading…
Cancel
Save