Commit 15c948b7 authored by lanbaoming's avatar lanbaoming

2024-06-20提交

parent 4859b972
...@@ -62,6 +62,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -62,6 +62,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -401,7 +402,31 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B ...@@ -401,7 +402,31 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
public BoxMergePkgDO getMergePkgInfoById(Long id) { public BoxMergePkgDO getMergePkgInfoById(Long id) {
BoxMergePkgDO boxMergePkgDO = boxMergePkgMapper.selectById(id); BoxMergePkgDO boxMergePkgDO = boxMergePkgMapper.selectById(id);
if (boxMergePkgDO.getSumVolume() == null) { if (boxMergePkgDO.getSumVolume() == null) {
//lanbm 2024-06-20注释掉
boxMergePkgDO = boxMergePkgMapper.getMergePkgInfoById(id); boxMergePkgDO = boxMergePkgMapper.getMergePkgInfoById(id);
//根据长宽高计算箱的体积
if (boxMergePkgDO.getPkgHight() == null) {
boxMergePkgDO.setPkgHight(new BigDecimal(0));
}
if (boxMergePkgDO.getPkgWidth() == null) {
boxMergePkgDO.setPkgWidth(new BigDecimal(0));
}
if(boxMergePkgDO.getPkgLength()==null)
{
boxMergePkgDO.setPkgLength(new BigDecimal(0));
}
BigDecimal v=
boxMergePkgDO.getPkgHight().multiply(new BigDecimal(0.01)).
multiply(boxMergePkgDO.getPkgLength()).
multiply(new BigDecimal(0.01)).multiply(boxMergePkgDO.getPkgWidth()
).multiply(new BigDecimal(0.01));
//四舍五入
BigDecimal v2= v.setScale(1,BigDecimal.ROUND_HALF_UP);
boxMergePkgDO.setSumVolume(v2);
} }
return boxMergePkgDO; return boxMergePkgDO;
} }
......
...@@ -58,6 +58,7 @@ public class BoxMergePkgController { ...@@ -58,6 +58,7 @@ public class BoxMergePkgController {
@ApiOperation("更新合包箱") @ApiOperation("更新合包箱")
//@PreAuthorize("@ss.hasPermission('ecw:box-merge-pkg:update')") //@PreAuthorize("@ss.hasPermission('ecw:box-merge-pkg:update')")
public CommonResult<Boolean> updateBoxMergePkg(@Valid @RequestBody BoxMergePkgUpdateReqVO updateReqVO) { public CommonResult<Boolean> updateBoxMergePkg(@Valid @RequestBody BoxMergePkgUpdateReqVO updateReqVO) {
//lanbm 2024-06-20 添加注释
boxMergePkgService.updateBoxMergePkg(updateReqVO); boxMergePkgService.updateBoxMergePkg(updateReqVO);
return success(true); return success(true);
} }
...@@ -140,7 +141,9 @@ public class BoxMergePkgController { ...@@ -140,7 +141,9 @@ public class BoxMergePkgController {
@ApiOperation("获得封箱数据") @ApiOperation("获得封箱数据")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthorize("@ss.hasPermission('ecw:box-pkg-order:query')") //@PreAuthorize("@ss.hasPermission('ecw:box-pkg-order:query')")
public CommonResult<BoxMergePkgBackVO> getMergePkgInfoById(@RequestParam("id") Long id) { public CommonResult<BoxMergePkgBackVO> getMergePkgInfoById(
@RequestParam("id") Long id) {
//lanbm 2024-06-20 添加注释
BoxMergePkgDO boxMergePkgBackVO = boxMergePkgService.getMergePkgInfoById(id); BoxMergePkgDO boxMergePkgBackVO = boxMergePkgService.getMergePkgInfoById(id);
return success(BoxMergePkgConvert.INSTANCE.convert(boxMergePkgBackVO)); return success(BoxMergePkgConvert.INSTANCE.convert(boxMergePkgBackVO));
} }
......
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