|
@@ -71,7 +71,7 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
.doSelectPage(() -> baseVehicleMapper.selectList(wrapper));
|
|
|
if (!StringUtils.isEmptySunhh(page) && page.getResult().size() > 0) {
|
|
|
List<BaseVehicle> dto1 = page.getResult().stream().map(o -> {
|
|
|
- BaseVehicleTerminal baseVehicleTerminal = baseVehicleTerminalMapper.selectTerminal(o.getVehicleCode());
|
|
|
+ BaseVehicleTerminal baseVehicleTerminal = baseVehicleTerminalMapper.selectTerminal(o.getVehicleCode(),o.getEnds());
|
|
|
if (!StringUtils.isEmptySunhh(baseVehicleTerminal) && !StringUtils.isEmptySunhh(baseVehicleTerminal.getVehicleCode())) {
|
|
|
LambdaQueryWrapper<BaseTerminal> wrapperBaseTerminal = new LambdaQueryWrapper<>();
|
|
|
if (!StringUtils.isEmptySunhh(baseVehicleTerminal) && !StringUtils.isEmptySunhh(baseVehicleTerminal.getTerminalCode())) {
|
|
@@ -94,14 +94,14 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
|
|
|
@Override
|
|
|
public AjaxResult vehicleAdd(BaseVehicle baseVehicle, String userId) {
|
|
|
- LambdaQueryWrapper<BaseVehicle> wrapper = new LambdaQueryWrapper<BaseVehicle>();
|
|
|
- if (!StringUtils.isEmptySunhh(baseVehicle) && !StringUtils.isEmptySunhh(baseVehicle.getVehicleCode())) {
|
|
|
- wrapper.eq(BaseVehicle::getVehicleCode, baseVehicle.getVehicleCode());
|
|
|
- }
|
|
|
- List<BaseVehicle> baseVehicles = baseVehicleMapper.selectList(wrapper);
|
|
|
- if (baseVehicles.size() > 0) {
|
|
|
- return AjaxResult.error("机车号已存在!");
|
|
|
- }
|
|
|
+// LambdaQueryWrapper<BaseVehicle> wrapper = new LambdaQueryWrapper<BaseVehicle>();
|
|
|
+// if (!StringUtils.isEmptySunhh(baseVehicle) && !StringUtils.isEmptySunhh(baseVehicle.getVehicleCode())) {
|
|
|
+// wrapper.eq(BaseVehicle::getVehicleCode, baseVehicle.getVehicleCode());
|
|
|
+// }
|
|
|
+// List<BaseVehicle> baseVehicles = baseVehicleMapper.selectList(wrapper);
|
|
|
+// if (baseVehicles.size() > 0) {
|
|
|
+// return AjaxResult.error("机车号已存在!");
|
|
|
+// }
|
|
|
Date date = new Date();
|
|
|
baseVehicle.setCreateBy(userId);
|
|
|
baseVehicle.setUpdateBy(userId);
|
|
@@ -117,17 +117,17 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
|
|
|
@Override
|
|
|
public AjaxResult vehicleUpdate(BaseVehicle baseVehicle, String userId) {
|
|
|
- LambdaQueryWrapper<BaseVehicle> wrapper = new LambdaQueryWrapper<>();
|
|
|
- if (!StringUtils.isEmptySunhh(baseVehicle) && !StringUtils.isEmptySunhh(baseVehicle.getVehicleCode())) {
|
|
|
- wrapper.eq(BaseVehicle::getVehicleCode, baseVehicle.getVehicleCode());
|
|
|
- }
|
|
|
- if (!StringUtils.isEmptySunhh(baseVehicle) && !StringUtils.isEmptySunhh(baseVehicle.getId())) {
|
|
|
- wrapper.ne(BaseVehicle::getId, baseVehicle.getId());
|
|
|
- }
|
|
|
- List<BaseVehicle> baseVehicles = baseVehicleMapper.selectList(wrapper);
|
|
|
- if (baseVehicles.size() > 0) {
|
|
|
- return AjaxResult.error("机车号已存在!");
|
|
|
- }
|
|
|
+// LambdaQueryWrapper<BaseVehicle> wrapper = new LambdaQueryWrapper<>();
|
|
|
+// if (!StringUtils.isEmptySunhh(baseVehicle) && !StringUtils.isEmptySunhh(baseVehicle.getVehicleCode())) {
|
|
|
+// wrapper.eq(BaseVehicle::getVehicleCode, baseVehicle.getVehicleCode());
|
|
|
+// }
|
|
|
+// if (!StringUtils.isEmptySunhh(baseVehicle) && !StringUtils.isEmptySunhh(baseVehicle.getId())) {
|
|
|
+// wrapper.ne(BaseVehicle::getId, baseVehicle.getId());
|
|
|
+// }
|
|
|
+// List<BaseVehicle> baseVehicles = baseVehicleMapper.selectList(wrapper);
|
|
|
+// if (baseVehicles.size() > 0) {
|
|
|
+// return AjaxResult.error("机车号已存在!");
|
|
|
+// }
|
|
|
baseVehicle.setUpdateBy(userId);
|
|
|
baseVehicle.setUpdateTime(new Date());
|
|
|
int update = baseVehicleMapper.updateById(baseVehicle);
|
|
@@ -149,12 +149,12 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
BaseVehicle baseVehicle = new BaseVehicle();
|
|
|
BeanUtils.copyProperties(baseVehicle2, baseVehicle);
|
|
|
// 判断机车号是否存在
|
|
|
- LambdaQueryWrapper<BaseVehicle> lw = new LambdaQueryWrapper<BaseVehicle>();
|
|
|
- if (!StringUtils.isEmptySunhh(baseVehicle.getVehicleCode())) {
|
|
|
- lw.eq(BaseVehicle::getVehicleCode, baseVehicle.getVehicleCode());
|
|
|
- }
|
|
|
- BaseVehicle baseVehicle1 = baseVehicleMapper.selectOne(lw);
|
|
|
- if (ObjectUtils.isEmpty(baseVehicle1)) {
|
|
|
+// LambdaQueryWrapper<BaseVehicle> lw = new LambdaQueryWrapper<BaseVehicle>();
|
|
|
+// if (!StringUtils.isEmptySunhh(baseVehicle.getVehicleCode())) {
|
|
|
+// lw.eq(BaseVehicle::getVehicleCode, baseVehicle.getVehicleCode());
|
|
|
+// }
|
|
|
+// BaseVehicle baseVehicle1 = baseVehicleMapper.selectOne(lw);
|
|
|
+// if (ObjectUtils.isEmpty(baseVehicle1)) {
|
|
|
BeanValidators.validateWithException(validator, baseVehicle);
|
|
|
baseVehicle.setUpdateBy(userId);
|
|
|
baseVehicle.setCreateBy(userId);
|
|
@@ -178,10 +178,10 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
// baseVehicleMapper.updateById(baseVehicle);
|
|
|
// successNum++;
|
|
|
// successMsg.append(successNum + "、机车号 " + baseVehicle.getVehicleCode() + " 更新成功");
|
|
|
- } else {
|
|
|
- failureNum++;
|
|
|
- failureMsg.append(failureNum + "、机车号 " + baseVehicle.getVehicleCode() + "已存在");
|
|
|
- }
|
|
|
+// } else {
|
|
|
+// failureNum++;
|
|
|
+// failureMsg.append(failureNum + "、机车号 " + baseVehicle.getVehicleCode() + "已存在");
|
|
|
+// }
|
|
|
} catch (Exception e) {
|
|
|
String msg = null;
|
|
|
failureNum++;
|
|
@@ -223,7 +223,7 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
}
|
|
|
List<BaseVehicle> baseVehicles = baseVehicleMapper.selectList(wrapper);
|
|
|
for (BaseVehicle baseVehicle1 : baseVehicles) {
|
|
|
- BaseVehicleTerminal baseTerminal = baseVehicleTerminalMapper.selectTerminal(baseVehicle1.getVehicleCode());
|
|
|
+ BaseVehicleTerminal baseTerminal = baseVehicleTerminalMapper.selectTerminal(baseVehicle1.getVehicleCode(),baseVehicle1.getEnds());
|
|
|
if (!StringUtils.isEmptySunhh(baseTerminal) && !StringUtils.isEmptySunhh(baseTerminal.getVehicleCode())) {
|
|
|
LambdaQueryWrapper<BaseTerminal> wrapperBaseVehicleTerminal = new LambdaQueryWrapper<>();
|
|
|
if (!StringUtils.isEmptySunhh(baseTerminal) && !StringUtils.isEmptySunhh(baseTerminal.getTerminalCode())) {
|
|
@@ -242,7 +242,7 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
|
|
|
@Override
|
|
|
public IPage<BaseVehicleTerminalVo> vehicleTerminal(BaseVehicleVo baseVehicleVo) {
|
|
|
- BaseVehicleTerminal baseTerminal = baseVehicleTerminalMapper.selectTerminal(baseVehicleVo.getVehicleCode());
|
|
|
+ BaseVehicleTerminal baseTerminal = baseVehicleTerminalMapper.selectTerminal(baseVehicleVo.getVehicleCode(),baseVehicleVo.getEnds());
|
|
|
List<String> terminalCodeList = baseVehicleTerminalMapper.selectMountCode(baseVehicleVo.getVehicleCode());
|
|
|
// List<String> collect = terminalCodeList.stream().map(BaseTerminal::getTerminalCode).collect(Collectors.toList());
|
|
|
LambdaQueryWrapper<BaseTerminal> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -302,6 +302,7 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
baseTerminal2.setTerminalCode(baseTerminal1.getTerminalCode());
|
|
|
baseTerminal2.setCreateBy(userId);
|
|
|
baseTerminal2.setUpdateBy(userId);
|
|
|
+ baseTerminal2.setEnds(baseTerminal1.getEnds());
|
|
|
Date date = new Date();
|
|
|
baseTerminal2.setCreateTime(date);
|
|
|
baseTerminal2.setUpdateTime(date);
|
|
@@ -311,6 +312,7 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
baseTerminal.setUpdateTime(new Date());
|
|
|
baseTerminal.setVehicleCode(baseTerminal1.getVehicleCode());
|
|
|
baseTerminal.setTerminalCode(baseTerminal1.getTerminalCode());
|
|
|
+ baseTerminal.setEnds(baseTerminal1.getEnds());
|
|
|
int updateById = baseVehicleTerminalMapper.updateById(baseTerminal);
|
|
|
}
|
|
|
return AjaxResult.success();
|
|
@@ -360,7 +362,7 @@ public class BaseVehicleServiceImpl extends ServiceImpl<BaseVehicleMapper, BaseV
|
|
|
List<String> terminalCodeList = new ArrayList<>();
|
|
|
baseVehicles = baseVehicles.stream().map(o -> {
|
|
|
//查到已保存的关联信息
|
|
|
- BaseVehicleTerminal baseVehicleTerminal = baseVehicleTerminalMapper.selectTerminal(o.getVehicleCode());
|
|
|
+ BaseVehicleTerminal baseVehicleTerminal = baseVehicleTerminalMapper.selectTerminal(o.getVehicleCode(),o.getEnds());
|
|
|
if (!StringUtils.isEmptySunhh(baseVehicleTerminal) && !StringUtils.isEmptySunhh(baseVehicleTerminal.getVehicleCode())) {
|
|
|
terminalCodeList.add(baseVehicleTerminal.getVehicleCode());
|
|
|
LambdaQueryWrapper<BaseTerminal> wrapperBaseVehicleTerminal = new LambdaQueryWrapper<>();
|