提交 dff9ea74 作者: 李超杰

解決报错

父级 71713af9
package com.boco.nbd.wios.export.impl;
import com.boco.nbd.wios.export.Export;
import com.boco.nbd.wios.manage.convert.WallboxApplyConvert;
import com.boco.nbd.wios.manage.entity.bo.SupplierBo;
import com.boco.nbd.wios.manage.entity.bo.SupplierVo;
import com.boco.nbd.wios.manage.entity.bo.WallboxApply;
import com.boco.nbd.wios.manage.entity.cams.enums.OrderStatus;
import com.boco.nbd.wios.manage.entity.vo.WallboxApplyInstallListVO;
import com.boco.nbd.wios.manage.entity.vo.WallboxApplyReqVO;
import com.boco.nbd.wios.manage.mapper.def.WallboxApplyMapper;
import com.boco.nbd.wios.manage.service.impl.SupplierService;
import com.boco.nbd.wios.manage.service.impl.WallboxApplyService;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
......@@ -25,9 +22,8 @@ import java.util.List;
/**
* 辅材导出WallboxApplyInstallListVO
*
*
* @author
* @version
*/
@Service
public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
......@@ -36,13 +32,15 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
private WallboxApplyMapper wallboxApplyMapper;
@Autowired
private WallboxApplyService wallboxApplyService;
@Override
public List<WallboxApplyInstallListVO> getExportList(String json) throws Exception {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
WallboxApplyReqVO condition = mapper.readValue(json, WallboxApplyReqVO.class);
List<WallboxApplyInstallListVO> list = wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(condition));
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(condition, wallboxApply);
List<WallboxApplyInstallListVO> list = wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
LocalDateTime currentTime = LocalDateTime.now();
Long no = 1L;
for (WallboxApplyInstallListVO apply : list) {
......@@ -61,11 +59,11 @@ public class WallBoxExport implements Export<WallboxApplyInstallListVO> {
apply.setTimeRemaining(Long.toString(remainingHours));
apply.setId(no++);
apply.setNumber("1");
if (!StringUtils.isEmpty(apply.getInstallStatus())){
if (!StringUtils.isEmpty(apply.getInstallStatus())) {
apply.setInstallStatusName(OrderStatus.getText(Integer.parseInt(apply.getInstallStatus())));
}
}
return list;
}
}
......@@ -5,7 +5,6 @@ import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.boco.nbd.wios.manage.client.DepponClient;
import com.boco.nbd.wios.manage.convert.WallboxApplyConvert;
import com.boco.nbd.wios.manage.entity.bo.Order;
import com.boco.nbd.wios.manage.entity.bo.Supplier;
import com.boco.nbd.wios.manage.entity.bo.SupplierStaff;
......@@ -22,6 +21,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -65,7 +65,7 @@ public class WallboxApplyController {
@ApiImplicitParams({@ApiImplicitParam(name = "orderId", value = "订单id", dataType = "string", paramType = "query",
required = true), @ApiImplicitParam(name = "ifEmergency", value = "是否紧急0否,1是", dataType = "int",
paramType = "query", required = true),})
public BaseResponse<Object> applyInstallation(String orderId, Integer ifEmergency,String receiverWarehouseId) {
public BaseResponse<Object> applyInstallation(String orderId, Integer ifEmergency, String receiverWarehouseId) {
Assert.notNull(orderId, "订单id不能为空");
Order order = orderService.get(orderId);
if (ObjectUtil.isNull(order)) {
......@@ -106,8 +106,10 @@ public class WallboxApplyController {
required = true), @ApiImplicitParam(name = "pagecount", value = "页码", dataType = "int", paramType =
"query", required = true)})
public BaseResponse<List<WallboxApplyInstallListVO>> list(WallboxApplyReqVO req) {
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(req, wallboxApply);
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(req));
wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
LocalDateTime currentTime = LocalDateTime.now();
for (WallboxApplyInstallListVO apply : list) {
apply.setNumber("1");
......@@ -145,8 +147,10 @@ public class WallboxApplyController {
throw new ServiceException("供应商不存在");
}
req.setSupplierId(supplier.getId());
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(req, wallboxApply);
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(req));
wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
LocalDateTime currentTime = LocalDateTime.now();
for (WallboxApplyInstallListVO apply : list) {
Date createdDate = apply.getCreatedTime();
......@@ -197,8 +201,10 @@ public class WallboxApplyController {
required = true), @ApiImplicitParam(name = "pagecount", value = "页码", dataType = "int", paramType =
"query", required = true)})
public void export(HttpServletResponse response, WallboxApplyReqVO req) throws IOException {
WallboxApply wallboxApply = new WallboxApply();
BeanUtils.copyProperties(req, wallboxApply);
List<WallboxApplyInstallListVO> list =
wallboxApplyService.selectWallboxApplyListFromOrder(WallboxApplyConvert.INSTANCE.convert(req));
wallboxApplyService.selectWallboxApplyListFromOrder(wallboxApply);
ExcelUtils.write(response, "墙盒申请数据导出.xls", "墙盒申请数据", WallboxApplyInstallListVO.class, list);
}
......@@ -211,6 +217,7 @@ public class WallboxApplyController {
public BaseResponse<Object> getInfo(@PathVariable("id") Long id) {
return new BaseResponse<>(wallboxApplyService.selectWallboxApplyById(id));
}
/**
* 根据订单号查询详情
*/
......@@ -266,7 +273,7 @@ public class WallboxApplyController {
@ApiOperation(value = "查询当前账号所属团队")
@GetMapping("/getTeamOrder")
public BaseResponse<Object> getTeamOrder(){
public BaseResponse<Object> getTeamOrder() {
SessionInfo loginUser = tokenService.getUser();
String userId = loginUser.getUserId();
......
server:
tomcat:
uri-encoding: UTF-8
servlet:
context-path: /api2
spring:
http:
encoding:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论