Commit 9b6c262c authored by hezhen's avatar hezhen

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform into base-modify

parents f4ee4357 0a91060e
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;
import cn.hutool.core.bean.BeanUtil;
import com.ace.cache.annotation.Cache;
import com.ace.cache.annotation.CacheClear;
import com.github.pagehelper.PageHelper;
......@@ -10,10 +11,13 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey;
import com.xxfc.platform.vehicle.entity.BranchCompany;
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.mapper.BranchCompanyMapper;
import com.xxfc.platform.vehicle.rest.BranchCompanyController;
import com.xxfc.platform.vehicle.util.excel.ExcelImport;
import com.xxfc.platform.vehicle.vo.BranchCompanyVo;
import com.xxfc.platform.vehicle.vo.CompanyDetail;
import com.xxfc.platform.vehicle.vo.CompanySearchDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import lombok.extern.slf4j.Slf4j;
......@@ -53,6 +57,9 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
@Autowired
private RedisTemplate customRedisTemplate;
@Autowired
private SysRegionBiz sysRegionBiz;
@Value("${branchCompanyPic.baseUploadPath}")
private String baseUploadPath ;
......@@ -61,10 +68,27 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
* @param id
* @return
*/
public BranchCompany getById(Integer id){
public BranchCompany getById(Integer 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){
BranchCompany param = new BranchCompany();
param.setId(id);
......
......@@ -9,12 +9,16 @@ import com.xxfc.platform.vehicle.common.BaseController;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.ResCode.ResCode;
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.dto.UserDTO;
import com.xxfc.platform.vehicle.vo.BranchCompanyVo;
import com.xxfc.platform.vehicle.vo.CompanyDetail;
import com.xxfc.platform.vehicle.vo.CompanySearchDTO;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
......@@ -71,9 +75,10 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
return RestResponse.data(baseBiz.getAll());
}
@ApiOperation("获取公司详情")
@RequestMapping(value ="/{id}",method = RequestMethod.GET)
public RestResponse<BranchCompany> get(@PathVariable Integer id) {
return RestResponse.data(baseBiz.getById(id));
public RestResponse<CompanyDetail> get(@PathVariable Integer id) {
return RestResponse.data(baseBiz.getDetailById(id));
}
@RequestMapping(value ="",method = RequestMethod.POST)
......
......@@ -296,8 +296,6 @@ public class VehicleController extends BaseController<VehicleBiz> {
PageDataVO<Vehicle> pageDataVO = vehicleBiz.searchUsableVehicle(dto);
bookVehicleVo.setVehicle(pageDataVO.getData().get(0).getId());
// new ObjectRestResponse<>().data();
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