Commit bdb20ebd by 刘宇峰

车型管理

1 parent aed7e692
......@@ -43,16 +43,12 @@
<version>0.8.1.1</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jdmk</groupId>
<artifactId>jmxtools</artifactId>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.jmx</groupId>
<artifactId>jmxri</artifactId>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
</exclusion>
</exclusions>
</dependency>
......@@ -97,6 +93,23 @@
<artifactId>ne-shield-publiccenter-api</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.glsx</groupId>
<artifactId>rest-admin-dubbo</artifactId>
</dependency>
<dependency>
<groupId>com.glsx.biz</groupId>
<artifactId>biz-base-service</artifactId>
<version>3.0.0-SNAPSHOT</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
......
......@@ -11,6 +11,10 @@ import cn.com.glsx.admin.modules.service.VehicleService;
import cn.com.glsx.admin.modules.utils.FileIOUtil;
import com.alibaba.excel.EasyExcel;
import com.github.pagehelper.PageInfo;
import com.glsx.biz.common.base.entity.CarBrandSelected;
import com.glsx.biz.common.base.entity.Carbrand;
import com.glsx.biz.common.base.entity.Carseries;
import com.glsx.biz.common.base.entity.Cartype;
import com.glsx.plat.common.annotation.SysLog;
import com.glsx.plat.common.enums.OperateType;
import com.glsx.plat.common.utils.DateUtils;
......@@ -165,4 +169,39 @@ public class VehicleController {
return R.ok().putPageData(pageInfo);
}
@ApiOperation(value = "车辆品牌系别查询")
@GetMapping("/brandseries")
public R<List<CarBrandSelected>> brandsSeries() {
List<CarBrandSelected> carBrandSeriesList = vehicleService.getCarBrandSeriesList();
return R.ok().data(carBrandSeriesList);
}
@ApiOperation(value = "车辆品牌查询")
@GetMapping("/brands")
public R<List<Carbrand>> brands() {
List<Carbrand> carBrandList = vehicleService.getAllBrandList();
return R.ok().data(carBrandList);
}
@ApiOperation(value = "车辆子品牌查询")
@GetMapping("/subbrands")
public R<List<Carbrand>> subBrands(@RequestParam Long brandId) {
List<Carbrand> carBrandList = vehicleService.getSubBrandsByBrandId(brandId);
return R.ok().data(carBrandList);
}
@ApiOperation(value = "车辆系别查询")
@GetMapping("/series")
public R<List<Carseries>> series(@RequestParam Long brandId) {
List<Carseries> carSeriesList = vehicleService.getSeriesByBrandId(brandId);
return R.ok().data(carSeriesList);
}
@ApiOperation(value = "车辆类型查询")
@GetMapping("/types")
public R<List<Cartype>> types(@RequestParam Long seriesId) {
List<Cartype> carTypeList = vehicleService.getTypesBySeriesId(seriesId);
return R.ok().data(carTypeList);
}
}
......@@ -14,6 +14,9 @@ public class SimpleTreeModel implements Serializable {
private String code;
private String label;
private Long parentId;
/**
* 组织类型:0部门,1用户
*/
private Integer type;
private boolean isRoot;
private List<SimpleTreeModel> children;
......
......@@ -5,7 +5,6 @@ import cn.com.glsx.admin.common.constants.ConstantsDevice;
import cn.com.glsx.admin.common.constants.ConstantsVehicle;
import cn.com.glsx.admin.common.enums.ResultEnum;
import cn.com.glsx.admin.common.exception.AdminException;
import cn.com.glsx.admin.modules.entity.Device;
import cn.com.glsx.admin.modules.entity.TransAccountData;
import cn.com.glsx.admin.modules.entity.Vehicle;
import cn.com.glsx.admin.modules.entity.VehicleDevice;
......@@ -24,11 +23,19 @@ import cn.com.glsx.usercenter.api.dto.request.FindUserRequest;
import cn.com.glsx.usercenter.api.dto.response.User;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.glsx.biz.common.base.entity.CarBrandSelected;
import com.glsx.biz.common.base.entity.Carbrand;
import com.glsx.biz.common.base.entity.Carseries;
import com.glsx.biz.common.base.entity.Cartype;
import com.glsx.biz.common.base.service.CarbrandService;
import com.glsx.biz.common.base.service.CarseriesService;
import com.glsx.biz.common.base.service.CartypeService;
import com.glsx.plat.common.utils.StringUtils;
import com.glsx.plat.context.utils.PropertiesUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -64,13 +71,25 @@ public class VehicleService {
@Autowired
private OrganizaService organizaService;
@Autowired
private DictService dictService;
@Autowired
private TransAccountDataService transAccountService;
@Autowired
private ElectricFenceService fenceService;
@DubboReference(version = "2.2.0")
private CarbrandService carbrandService;
@DubboReference(version = "2.2.0")
private CarseriesService carseriesService;
@DubboReference(version = "2.2.0")
private CartypeService cartypeService;
public PageInfo<TrialDriveVehiclePageDTO> searchTrialDrive(VehicleManageSearch search) {
PageHelper.startPage(search.getPageNumber(), search.getPageSize());
List<TrialDriveVehiclePageDTO> listDriveVehicle = vehicleMapper.searchTrialDrive(search);
......@@ -87,6 +106,7 @@ public class VehicleService {
/**
* 根据车架号查询车辆是否存在(基础)
*
* @param vin
* @return
*/
......@@ -100,6 +120,7 @@ public class VehicleService {
/**
* 删除车辆 (基础)
*
* @param vehicleId
*/
@Transactional(rollbackFor = Exception.class)
......@@ -221,6 +242,7 @@ public class VehicleService {
/**
* 现在绑定了的情况
*
* @param driveVehicleoBo
* @param sn
* @param bindVehicleDevice
......@@ -341,6 +363,7 @@ public class VehicleService {
/**
* 导出时间车辆数据
*
* @param search
* @return
*/
......@@ -351,6 +374,7 @@ public class VehicleService {
/**
* 同步车辆、设备信息
*
* @param vehicleBo
* @return
*/
......@@ -363,6 +387,7 @@ public class VehicleService {
/**
* 同步车辆、设备信息,并关联门店围栏
*
* @param vehicleBo
* @return
*/
......@@ -378,9 +403,9 @@ public class VehicleService {
}
/**
* 同步设备信息
*
* @param trackInfoList
* @param createId
* @param vehicleId
......@@ -404,6 +429,7 @@ public class VehicleService {
/**
* 同步车辆信息 入库
*
* @param vehicleBo
* @param createId
* @return
......@@ -423,13 +449,14 @@ public class VehicleService {
/**
* 匹配车型
*
* @param vehicleBo
*/
private void setModelParam(SyncVehicleBo vehicleBo) {
Map<String, Integer> modelMap = this.getDictDataByType(Constants.TRIALDRIVE_VEHICLE_MODEL);
String modelName = vehicleBo.getModelName();
if (StringUtils.isBlank(modelName)) {
return ;
return;
}
Integer modelId = modelMap.get(modelName);
if (modelId != null && modelId != 0) {
......@@ -441,6 +468,7 @@ public class VehicleService {
/**
* 查找创建人id
*
* @param classId
* @param shopName
* @return
......@@ -467,6 +495,7 @@ public class VehicleService {
/**
* 根据分类查找创建人
*
* @param classId
* @return
*/
......@@ -491,11 +520,12 @@ public class VehicleService {
/**
* 保存同步的车辆数据
*
* @param vehicleBo
* @param createId
* @return
*/
public Vehicle saveSyncVehicle(SyncVehicleBo vehicleBo, Long createId ) {
public Vehicle saveSyncVehicle(SyncVehicleBo vehicleBo, Long createId) {
Vehicle vehicle = new Vehicle();
BeanUtils.copyProperties(vehicleBo, vehicle);
vehicle.setVehicleType(ConstantsVehicle.TRIAL_DRIVE_TYPE);
......@@ -509,9 +539,9 @@ public class VehicleService {
}
/**
* 检查该设备是否绑定 如果绑定 则解除绑定 重新绑定新车辆
*
* @param sn
* @param vehicleId
* @param createId
......@@ -519,7 +549,7 @@ public class VehicleService {
public void checkAndBindNewVehicle(String sn, Long vehicleId, Long createId) {
VehicleDevice vehicleDevice = vehicleDeviceService.getVehicleDeviceBySnBind(sn);
Long existvehicleId = null;
if (vehicleDevice != null ) {
if (vehicleDevice != null) {
existvehicleId = vehicleDevice.getVehicleId();
if (vehicleId.equals(existvehicleId)) {
log.info("vehicleId:" + existvehicleId + "已经绑定了该设备sn:" + sn + ",不用重新绑定。");
......@@ -600,6 +630,7 @@ public class VehicleService {
/**
* 根据门店名和编码查找用户
*
* @param shopName
* @param shopCode
* @return
......@@ -613,6 +644,7 @@ public class VehicleService {
/**
* 批量插入数据
*
* @param driveList
*/
public void insertVehicleAndSnList(List<TrialDriveVehicleImport> driveList) {
......@@ -623,6 +655,7 @@ public class VehicleService {
/**
* 根据类型封装字典 key:id, value:DictLabel
*
* @param type
* @return
*/
......@@ -637,6 +670,7 @@ public class VehicleService {
/**
* 封装用户信息 key:门店编码 value:id
*
* @return
*/
public Map<String, Long> findUserIdMapByAccount() {
......@@ -650,4 +684,25 @@ public class VehicleService {
}
return userMap;
}
public List<CarBrandSelected> getCarBrandSeriesList() {
return carbrandService.getCarInfoCompleteForSelected();
}
public List<Carbrand> getAllBrandList() {
return carbrandService.getParentCarbrandList();
}
public List<Carbrand> getSubBrandsByBrandId(Long brandId) {
return carbrandService.listSubCarbrandByParentId(Math.toIntExact(brandId));
}
public List<Carseries> getSeriesByBrandId(Long brandId) {
return carseriesService.getByCarbrandId(Math.toIntExact(brandId));
}
public List<Cartype> getTypesBySeriesId(Long seriesId) {
return cartypeService.getBySeiesId(Math.toIntExact(seriesId));
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!