|
@@ -23,6 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
/**
|
|
@@ -137,6 +138,15 @@ public class GoodsProductServiceImpl implements GoodsProductService {
|
|
|
}
|
|
|
GoodsProductEntity goodsProductEntity = new GoodsProductEntity();
|
|
|
BeanUtils.copyProperties(goodsProductDto,goodsProductEntity);
|
|
|
+ goodsProductEntity.setLegalUnit1Qty(new BigDecimal(goodsProductDto.getLegalUnit1Qty()));
|
|
|
+ goodsProductEntity.setLegalUnit2Qty(new BigDecimal(goodsProductDto.getLegalUnit2Qty()));
|
|
|
+ goodsProductEntity.setNetWeight(new BigDecimal(goodsProductDto.getNetWeight()));
|
|
|
+ if (!StringUtils.isEmpty(goodsProductDto.getGrossWeight())) {
|
|
|
+ goodsProductEntity.setGrossWeight(new BigDecimal(goodsProductDto.getGrossWeight()));
|
|
|
+ }
|
|
|
+ goodsProductEntity.setGrossWeight(goodsProductEntity.getNetWeight().add(new BigDecimal("0.05")));
|
|
|
+
|
|
|
+ goodsProductEntity.setDeclPrice(new BigDecimal(goodsProductDto.getDeclPrice()));
|
|
|
goodsProductEntity.setCreateTime(new Date());
|
|
|
goodsProductEntity.setCreaterSn(ShiroUtils.getUserId().toString());
|
|
|
goodsProductDao.save(goodsProductEntity);
|