|
@@ -2,12 +2,14 @@ package com.aoyang.tms.service.impl;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.aoyang.common.param.PageParam;
|
|
import com.aoyang.common.param.PageParam;
|
|
|
|
|
+import com.aoyang.common.result.Result;
|
|
|
import com.aoyang.tms.controller.param.TruckEscortAddParam;
|
|
import com.aoyang.tms.controller.param.TruckEscortAddParam;
|
|
|
import com.aoyang.tms.controller.param.TruckEscortListParam;
|
|
import com.aoyang.tms.controller.param.TruckEscortListParam;
|
|
|
import com.aoyang.tms.entity.Truck;
|
|
import com.aoyang.tms.entity.Truck;
|
|
|
import com.aoyang.tms.entity.TruckDriver;
|
|
import com.aoyang.tms.entity.TruckDriver;
|
|
|
import com.aoyang.tms.entity.TruckEscort;
|
|
import com.aoyang.tms.entity.TruckEscort;
|
|
|
import com.aoyang.tms.entity.User;
|
|
import com.aoyang.tms.entity.User;
|
|
|
|
|
+import com.aoyang.tms.feign.UserFeignClient;
|
|
|
import com.aoyang.tms.mapper.TruckEscortMapper;
|
|
import com.aoyang.tms.mapper.TruckEscortMapper;
|
|
|
import com.aoyang.tms.service.CommonService;
|
|
import com.aoyang.tms.service.CommonService;
|
|
|
import com.aoyang.tms.service.TruckDriverService;
|
|
import com.aoyang.tms.service.TruckDriverService;
|
|
@@ -40,7 +42,9 @@ import java.util.List;
|
|
|
public class TruckEscortServiceImpl extends ServiceImpl<TruckEscortMapper, TruckEscort> implements TruckEscortService {
|
|
public class TruckEscortServiceImpl extends ServiceImpl<TruckEscortMapper, TruckEscort> implements TruckEscortService {
|
|
|
|
|
|
|
|
@Resource
|
|
@Resource
|
|
|
- TruckEscortMapper truckEscortMapper;
|
|
|
|
|
|
|
+ private TruckEscortMapper truckEscortMapper;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private UserFeignClient userFeignClient;
|
|
|
@Resource
|
|
@Resource
|
|
|
private CommonService commonService;
|
|
private CommonService commonService;
|
|
|
|
|
|
|
@@ -89,7 +93,7 @@ public class TruckEscortServiceImpl extends ServiceImpl<TruckEscortMapper, Truck
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public boolean add(TruckEscortAddParam param) {
|
|
|
|
|
|
|
+ public Result<Boolean> add(TruckEscortAddParam param) {
|
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
|
//添加用户
|
|
//添加用户
|
|
|
User user = new User();
|
|
User user = new User();
|
|
@@ -101,7 +105,11 @@ public class TruckEscortServiceImpl extends ServiceImpl<TruckEscortMapper, Truck
|
|
|
user.setCreater(param.getCreater());
|
|
user.setCreater(param.getCreater());
|
|
|
user.setCreaterName(param.getCreaterName());
|
|
user.setCreaterName(param.getCreaterName());
|
|
|
user.setCreateDate(param.getCreateDate());
|
|
user.setCreateDate(param.getCreateDate());
|
|
|
- User userSave = commonService.addUser(user);
|
|
|
|
|
|
|
+ Result<User> result = userFeignClient.add(user.getCreater() + "", user);
|
|
|
|
|
+ if (!commonService.verifyResult(result)) {
|
|
|
|
|
+ return new Result<>(result.getCode(), result.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+ User userSave =result.getData();
|
|
|
log.info("添加新的user,参数:{}", JSON.toJSONString(userSave));
|
|
log.info("添加新的user,参数:{}", JSON.toJSONString(userSave));
|
|
|
|
|
|
|
|
if (userSave != null) {
|
|
if (userSave != null) {
|
|
@@ -126,7 +134,7 @@ public class TruckEscortServiceImpl extends ServiceImpl<TruckEscortMapper, Truck
|
|
|
}
|
|
}
|
|
|
flag = saveOrUpdate(truckEscort);
|
|
flag = saveOrUpdate(truckEscort);
|
|
|
}
|
|
}
|
|
|
- return flag;
|
|
|
|
|
|
|
+ return new Result<>(flag);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|