提交 dff9ea74 作者: 李超杰

解決报错

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