Commit 6bc61b2d authored by 周健威's avatar 周健威

修改车型详情

parent 19982643
package com.xxfc.platform.vehicle.vo;
import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.SysRegion;
import lombok.Data;
import java.util.List;
@Data
public class CompanyDetail extends BranchCompany {
List<SysRegion> sysRegions;
}
\ No newline at end of file
package com.xxfc.platform.vehicle.biz; package com.xxfc.platform.vehicle.biz;
import cn.hutool.core.bean.BeanUtil;
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear; import com.ace.cache.annotation.CacheClear;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -10,10 +11,13 @@ import com.xxfc.platform.vehicle.common.RestResponse; ...@@ -10,10 +11,13 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey; import com.xxfc.platform.vehicle.constant.RedisKey;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo; import com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo;
import com.xxfc.platform.vehicle.entity.SysRegion;
import com.xxfc.platform.vehicle.feign.dto.UserDTO; import com.xxfc.platform.vehicle.feign.dto.UserDTO;
import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper; import com.xxfc.platform.vehicle.mapper.BranchCompanyMapper;
import com.xxfc.platform.vehicle.rest.BranchCompanyController;
import com.xxfc.platform.vehicle.util.excel.ExcelImport; import com.xxfc.platform.vehicle.util.excel.ExcelImport;
import com.xxfc.platform.vehicle.vo.BranchCompanyVo; import com.xxfc.platform.vehicle.vo.BranchCompanyVo;
import com.xxfc.platform.vehicle.vo.CompanyDetail;
import com.xxfc.platform.vehicle.vo.CompanySearchDTO; import com.xxfc.platform.vehicle.vo.CompanySearchDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -53,6 +57,9 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -53,6 +57,9 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
@Autowired @Autowired
private RedisTemplate customRedisTemplate; private RedisTemplate customRedisTemplate;
@Autowired
private SysRegionBiz sysRegionBiz;
@Value("${branchCompanyPic.baseUploadPath}") @Value("${branchCompanyPic.baseUploadPath}")
private String baseUploadPath ; private String baseUploadPath ;
...@@ -61,10 +68,27 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany ...@@ -61,10 +68,27 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
* @param id * @param id
* @return * @return
*/ */
public BranchCompany getById(Integer id){ public BranchCompany getById(Integer id) {
return mapper.selectByPrimaryKey(id); return mapper.selectByPrimaryKey(id);
} }
/**
* 获取公司信息
* @param id
* @return
*/
public CompanyDetail getDetailById(Integer id) {
BranchCompany branchCompany = this.getById(id);
List<SysRegion> sysRegions = sysRegionBiz.getRegionsByCodes(new ArrayList<Long>(){{
add(Long.valueOf(branchCompany.getAddrProvince()));
add(Long.valueOf(branchCompany.getAddrCity()));
add(Long.valueOf(branchCompany.getAddrTown()));
}});
CompanyDetail detail = BeanUtil.toBean(branchCompany, CompanyDetail.class);
detail.setSysRegions(sysRegions);
return detail;
}
public Boolean exits(Integer id){ public Boolean exits(Integer id){
BranchCompany param = new BranchCompany(); BranchCompany param = new BranchCompany();
param.setId(id); param.setId(id);
......
...@@ -9,12 +9,16 @@ import com.xxfc.platform.vehicle.common.BaseController; ...@@ -9,12 +9,16 @@ import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.common.RestResponse; import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode; import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
import com.xxfc.platform.vehicle.entity.BranchCompany; import com.xxfc.platform.vehicle.entity.BranchCompany;
import com.xxfc.platform.vehicle.entity.SysRegion;
import com.xxfc.platform.vehicle.feign.UserFeign; import com.xxfc.platform.vehicle.feign.UserFeign;
import com.xxfc.platform.vehicle.feign.dto.UserDTO; import com.xxfc.platform.vehicle.feign.dto.UserDTO;
import com.xxfc.platform.vehicle.vo.BranchCompanyVo; import com.xxfc.platform.vehicle.vo.BranchCompanyVo;
import com.xxfc.platform.vehicle.vo.CompanyDetail;
import com.xxfc.platform.vehicle.vo.CompanySearchDTO; import com.xxfc.platform.vehicle.vo.CompanySearchDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO; import com.github.wxiaoqi.security.common.vo.PageDataVO;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -71,9 +75,10 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> { ...@@ -71,9 +75,10 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
return RestResponse.data(baseBiz.getAll()); return RestResponse.data(baseBiz.getAll());
} }
@ApiOperation("获取公司详情")
@RequestMapping(value ="/{id}",method = RequestMethod.GET) @RequestMapping(value ="/{id}",method = RequestMethod.GET)
public RestResponse<BranchCompany> get(@PathVariable Integer id) { public RestResponse<CompanyDetail> get(@PathVariable Integer id) {
return RestResponse.data(baseBiz.getById(id)); return RestResponse.data(baseBiz.getDetailById(id));
} }
@RequestMapping(value ="",method = RequestMethod.POST) @RequestMapping(value ="",method = RequestMethod.POST)
......
...@@ -296,8 +296,6 @@ public class VehicleController extends BaseController<VehicleBiz> { ...@@ -296,8 +296,6 @@ public class VehicleController extends BaseController<VehicleBiz> {
PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto); PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto);
bookVehicleVo.setVehicle(pageDataVO.getData().get(0).getId()); bookVehicleVo.setVehicle(pageDataVO.getData().get(0).getId());
// new ObjectRestResponse<>().data();
return baseBiz.applyVehicle4Employee(operatorId, bookVehicleVo, userName); return baseBiz.applyVehicle4Employee(operatorId, bookVehicleVo, userName);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment