Commit 15c948b7 authored by lanbaoming's avatar lanbaoming

2024-06-20提交

parent 4859b972
......@@ -62,6 +62,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.*;
import java.util.stream.Collectors;
......@@ -401,7 +402,31 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
public BoxMergePkgDO getMergePkgInfoById(Long id) {
BoxMergePkgDO boxMergePkgDO = boxMergePkgMapper.selectById(id);
if (boxMergePkgDO.getSumVolume() == null) {
//lanbm 2024-06-20注释掉
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;
}
......
......@@ -58,6 +58,7 @@ public class BoxMergePkgController {
@ApiOperation("更新合包箱")
//@PreAuthorize("@ss.hasPermission('ecw:box-merge-pkg:update')")
public CommonResult<Boolean> updateBoxMergePkg(@Valid @RequestBody BoxMergePkgUpdateReqVO updateReqVO) {
//lanbm 2024-06-20 添加注释
boxMergePkgService.updateBoxMergePkg(updateReqVO);
return success(true);
}
......@@ -140,7 +141,9 @@ public class BoxMergePkgController {
@ApiOperation("获得封箱数据")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@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);
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