09-28-节点批量更新优化,工单平均响应时间修复

This commit is contained in:
2025-09-28 19:41:40 +08:00
parent dd5cb05649
commit f9edc2d15d
2 changed files with 6 additions and 3 deletions

View File

@ -118,12 +118,13 @@ public class OpsInspectionNodeServiceImpl implements IOpsInspectionNodeService {
*/
@Override
public Boolean updateByBo(List<OpsInspectionNodeBo> bo) {
List<OpsInspectionNode> nodes = new ArrayList<>();
for (OpsInspectionNodeBo nodeBo : bo) {
OpsInspectionNode update = MapstructUtils.convert(nodeBo, OpsInspectionNode.class);
validEntityBeforeSave(update);
baseMapper.updateById(update);
nodes.add(update);
}
return true;
return baseMapper.updateBatchById(nodes);
}
/**

View File

@ -284,13 +284,15 @@ public class OpsInspectionOrderServiceImpl implements IOpsInspectionOrderService
BigDecimal bypdzs = BigDecimal.valueOf(thisMonth.size());
//统计平均响应时间
Long zgxysj = 0L;//总共响应时间
Long jds = 0L;//本月接单数 有接单才有响应时间
for (OpsInspectionOrderVo orderVo : thisMonth) {
if (orderVo.getGetOrderTime() != null) {
jds++;
zgxysj += orderVo.getGetOrderTime().getTime() - orderVo.getCreateTime().getTime();
}
}
//平均响应时间
BigDecimal avg = BigDecimal.valueOf(TimeUnit.MILLISECONDS.toMinutes(zgxysj));
BigDecimal avg = BigDecimal.valueOf(TimeUnit.MILLISECONDS.toMinutes(zgxysj)).divide(BigDecimal.valueOf(jds),2,RoundingMode.HALF_UP);
//统计待接收工单
int waiting = thisMonth.stream().filter(vo -> vo.getStatus().equals("2")).toList().size();
//待接单数