Commit 295a60f9 authored by hanfeng's avatar hanfeng

Merge branch 'master-bug-vehiclemodel-hf' into dev

parents 7bf1ea7b 4d81ee9c
......@@ -205,7 +205,7 @@ public class AppPermissionService {
return JsonResultUtil.createDefaultFail();
}
try {
result.put("mobilecode", mobilecode);
result.put("mobilecode", "");//mobilecode
String redisLockKey = RedisKey.CONSTANT_CODE_PREFIX + phone + mobilecode;
Boolean suc = userRedisTemplate.opsForValue().setIfAbsent(redisLockKey, mobilecode);
if (suc) {
......@@ -262,14 +262,14 @@ public class AppPermissionService {
}
}
}
/* String redisLockKey = RedisKey.CONSTANT_CODE_PREFIX + username + mobilecode;
String redisLockKey = RedisKey.CONSTANT_CODE_PREFIX + username + mobilecode;
String mobilecodeRedis = userRedisTemplate.opsForValue().get(redisLockKey) == null ? "" : userRedisTemplate.opsForValue().get(redisLockKey).toString();
log.info("注册接口,获取redis中的验证码:" + mobilecodeRedis+"---time===="+System.currentTimeMillis()/1000L);
// 获取到缓存的验证码后要先清空缓存对应键的值
userRedisTemplate.delete(redisLockKey);
if (StringUtils.isBlank(mobilecodeRedis)) {
return JsonResultUtil.createFailedResult(ResultCode.NOTEXIST_CODE, "验证码错误");
}*/
}
// 是否已存在
AppUserLogin user = appUserLoginBiz.checkeUserLogin(username);
if (null != user) {
......
......@@ -5,7 +5,7 @@ import lombok.Data;
import java.util.Date;
@Data
public class ResultVehicleVo {
public class ResultVehicleVo {
/**
* 主键(uuid)
*/
......
package com.xxfc.platform.vehicle.pojo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.HashMap;
import java.util.Map;
@Data
public class VehicleExcelVo {
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class VehicleExcelVo {
private static Map<Integer, String> map = new HashMap();
static {
map.put(1, "正常运行");
map.put(2, "维修");
map.put(3, "报废");
}
/**
* 车牌号,空字符串-没有
......@@ -34,7 +48,21 @@ public class VehicleExcelVo {
/**
* 停靠分支机构(名)
*/
private String parkBranchCompanyName;
/**
* 车辆状态: 1-正常运行 2-维修 3-报废
*/
private Integer status;
/**
* 所属人 名称
*/
private String belongToName;
public String getStatus() {
return map.get(status);
}
}
package com.xxfc.platform.vehicle.pojo;
import com.sun.org.apache.xpath.internal.operations.Bool;
import lombok.Data;
import java.util.Date;
......@@ -138,6 +139,9 @@ public class VehiclePageQueryVo {
*/
private Integer modelId;
/**
* 判断是否需要下载
*/
private boolean download;
}
......@@ -67,8 +67,8 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
try {
if (StringUtils.isNotBlank(vehiclePageQueryVoJson)){
vehiclePageQueryVo = JSON.parseObject(vehiclePageQueryVoJson, VehiclePageQueryVo.class);
vehiclePageQueryVo.setDownload(true);
}
if (userDTO.getDataAll() == 2) {
List<Integer> companyList = vehicleBiz.dataCompany(userDTO.getDataZone(), userDTO.getDataCompany());
return getByPageNotAllData(vehiclePageQueryVo, companyList);
......@@ -85,11 +85,18 @@ public class VehicleInformationDownloadBiz extends BaseBiz<VehicleMapper, Vehicl
public List<VehicleExcelVo> getList(String vehiclePageQueryVoJson, UserDTO userDTO) throws Exception {
List<ResultVehicleVo> resultVehicleVoList = getResultVehicleVoList(vehiclePageQueryVoJson, userDTO);
ArrayList<VehicleExcelVo> arrayList = Lists.newArrayList();
resultVehicleVoList.parallelStream().forEach(result->{
resultVehicleVoList.stream().forEach(result->{
try {
VehicleExcelVo vehicleExcelVo = new VehicleExcelVo();
BeanUtilsBean.getInstance().copyProperties(vehicleExcelVo,result);
arrayList.add(vehicleExcelVo);
VehicleExcelVo build = VehicleExcelVo.builder()
.code(result.getCode())
.numberPlate(result.getNumberPlate())
.parkBranchCompanyName(result.getParkBranchCompanyName())
.status(result.getStatus())
.useTypeName(result.getUseTypeName())
.vehicleType(result.getVehicleType())
.belongToName(result.getBelongToName())
.build();
arrayList.add(build);
} catch (Exception e) {
log.error(e.getMessage());
log.error(e.getMessage(), e);
......
......@@ -50,13 +50,18 @@ public class VehicleInformationDownloadController extends BaseController<Vehicle
if (userDTO == null) {
throw new BaseException("token已失效");
}
List<VehicleExcelVo> rows = baseBiz.getList(vehiclePageQueryVoJson, userDTO);
ExcelWriter writer = ExcelUtil.getWriter(true);
writer.addHeaderAlias("numberPlate", "车牌号");
writer.addHeaderAlias("code", "车辆编码");
writer.addHeaderAlias("vehicleType", "车型");
writer.addHeaderAlias("useTypeName", "用途");
writer.addHeaderAlias("numberPlate", "车牌号");
writer.addHeaderAlias("status", "车辆状态");
writer.addHeaderAlias("vehicleType", "车辆品牌");
writer.addHeaderAlias("parkBranchCompanyName", "停靠分公司");
writer.addHeaderAlias("useTypeName", "用途");
writer.addHeaderAlias("belongToName", "托管人");
// 一次性写出内容,使用默认样式,强制输出标题
writer.write(rows, true);
//response为HttpServletResponse对象
......
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