|
@@ -193,30 +193,36 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
public void getAndTransfer(Custom custom, User user) {
|
|
public void getAndTransfer(Custom custom, User user) {
|
|
- UpdateWrapper<Custom> updateWrapper = new UpdateWrapper<>();
|
|
|
|
- updateWrapper.eq("id", custom.getId());
|
|
|
|
- Custom custom1 = customMapper.selectById(custom.getId());
|
|
|
|
- String inchargerId = custom1.getInchargerId();
|
|
|
|
- if (inchargerId == null) {
|
|
|
|
- //认领
|
|
|
|
- ActionLog actionLog = new ActionLog();
|
|
|
|
- actionLog.setCode("custom");
|
|
|
|
- actionLog.setCreatTime(new Date());
|
|
|
|
- actionLog.setName("认领了客户");
|
|
|
|
- actionLog.setUserId(user.getId());
|
|
|
|
- actionLog.setItemId(custom.getId());
|
|
|
|
- actionLogMapper.insert(actionLog);
|
|
|
|
- } else {
|
|
|
|
- //转移
|
|
|
|
- ActionLog actionLog = new ActionLog();
|
|
|
|
- actionLog.setCode("custom");
|
|
|
|
- actionLog.setCreatTime(new Date());
|
|
|
|
- actionLog.setName("转移了客户");
|
|
|
|
- actionLog.setUserId(user.getId());
|
|
|
|
- actionLog.setItemId(custom.getId());
|
|
|
|
- actionLogMapper.insert(actionLog);
|
|
|
|
|
|
+ String ids1 = custom.getIds();
|
|
|
|
+ List<Integer> ids = Arrays.stream(ids1.split(","))
|
|
|
|
+ .map(Integer::parseInt)
|
|
|
|
+ .collect(Collectors.toList());
|
|
|
|
+ for (Integer id : ids) {
|
|
|
|
+ UpdateWrapper<Custom> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.eq("id", id);
|
|
|
|
+// updateWrapper.eq("id", custom.getId()).set("incharger_id",custom.getInchargerId());
|
|
|
|
+ String inchargerId = custom.getInchargerId();
|
|
|
|
+ if (inchargerId == null) {
|
|
|
|
+ //认领
|
|
|
|
+ ActionLog actionLog = new ActionLog();
|
|
|
|
+ actionLog.setCode("custom");
|
|
|
|
+ actionLog.setCreatTime(new Date());
|
|
|
|
+ actionLog.setName("认领了客户");
|
|
|
|
+ actionLog.setUserId(user.getId());
|
|
|
|
+ actionLog.setItemId(id);
|
|
|
|
+ actionLogMapper.insert(actionLog);
|
|
|
|
+ } else {
|
|
|
|
+ //转移
|
|
|
|
+ ActionLog actionLog = new ActionLog();
|
|
|
|
+ actionLog.setCode("custom");
|
|
|
|
+ actionLog.setCreatTime(new Date());
|
|
|
|
+ actionLog.setName("转移了客户");
|
|
|
|
+ actionLog.setUserId(user.getId());
|
|
|
|
+ actionLog.setItemId(id);
|
|
|
|
+ actionLogMapper.insert(actionLog);
|
|
|
|
+ }
|
|
|
|
+ customMapper.update(custom, updateWrapper);
|
|
}
|
|
}
|
|
- customMapper.update(custom, updateWrapper);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|