派单任务

This commit is contained in:
Chujinwang 2024-07-19 15:58:00 +08:00
parent 5f84334ae3
commit b4c09a46d4
2 changed files with 8 additions and 4 deletions

View File

@ -109,6 +109,7 @@ public class TerminalServiceImpl extends ServiceImpl<TerminalMapper, Terminal> i
for (Long terminalId : terminalIds) {
Terminal terminal = getById(terminalId);
terminal.setOccupy(i);
terminal.setVersion(0l);
baseMapper.updateById(terminal);
}
}

View File

@ -600,6 +600,7 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
wrkInfo.setWorkSource(query.getWorkSource());
wrkInfo.setTaskId(dispatch.getTaskId());
wrkInfo.setLowerTaskId(dispatch.getLowerTaskId());
wrkInfo.setVersion(0L);
// 处理时间
//wrkInfo.setDisposeTime(query.getEndTime());
// 业务员名字和客户经理?
@ -613,21 +614,23 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
Set<String> nickNames = StreamUtils.toSet(dispatch, DispatchDTO::getAccountManager);
Result<Map<String, Long>> result = userFeignService.getIdByNicknames(nickNames, SecurityConstants.INNER);
if (result.isSuccess()) {
Map<String, Long> userIds = result.getData();
// Map<String, Long> userIds = result.getData();
for (DispatchDTO dispatchDTO : dispatch) {
Long userId = userIds.get(dispatchDTO.getAccountManager());
Assert.notNull(userId, "【{}】未设置商户", dispatchDTO.getAccountManager());
// Long userId = userIds.get(dispatchDTO.getAccountManager());
// Assert.notNull(userId, "【{}】未设置商户", dispatchDTO.getAccountManager());
// 组装wrkinfo实体
WrkInfo wrkInfo = makeWrkInfoEntity(dispatchDTO, query, userId, dispatchDTO.getAccountManager(), 0);
WrkInfo wrkInfo = makeWrkInfoEntity(dispatchDTO, query, query.getUserId(), dispatchDTO.getAccountManager(), 0);
save(wrkInfo);
//组装wrkterminal 实体
WrkInfoTerminalRecord wrkInfoTerminalRecord = BeanUtil.copyProperties(dispatchDTO, WrkInfoTerminalRecord.class);
wrkInfoTerminalRecord.setWrkId(wrkInfo.getWrkId());
wrkInfoTerminalRecord.setVersion(0L);
wrkInfoTerminalRecordService.save(wrkInfoTerminalRecord);
WrkInfoStoreRecord wrkInfoStoreRecord = BeanUtil.copyProperties(dispatchDTO, WrkInfoStoreRecord.class);
wrkInfoStoreRecord.setWrkId(wrkInfo.getWrkId());
wrkInfoStoreRecord.setDeptId(SecurityUtils.getDeptId());
wrkInfoStoreRecord.setStoreId(dispatchDTO.getStoreId());
wrkInfoStoreRecord.setVersion(0L);
wrkInfoStoreRecordService.save(wrkInfoStoreRecord);
}
}