|
@@ -767,7 +767,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
builder.put("isHotStr", "热销");
|
|
|
builder.put("prodBarcode", "产品条码");
|
|
|
// builder.put("marketPrice", "市场价");
|
|
|
-// builder.put("retailPrice", "零售价");
|
|
|
+ builder.put("retailPrice", "零售价");
|
|
|
builder.put("supplierName", "供应商");
|
|
|
builder.put("goodsNumber", "商品总库存");
|
|
|
R r = ValidatorUtil.isEmpty(builder.build(), valideDate);
|
|
@@ -901,6 +901,7 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
}else {
|
|
|
goodsEntity.setFreightId(freightEntity.getId());
|
|
|
}*/
|
|
|
+ BigDecimal retailPrice = BigDecimal.ZERO;
|
|
|
if (!Dict.orderBizType.item_11.getItem().equals(goodsDto.getGoodsBizType())) {
|
|
|
SysCusUnitCodeEntity sysCusUnitCodeEntity = sysCusUnitCodeDao.queryObjectByName(goodsDto.getUnitName());
|
|
|
if (sysCusUnitCodeEntity == null) {
|
|
@@ -917,8 +918,18 @@ public class GoodsServiceImpl implements GoodsService {
|
|
|
} else {
|
|
|
goodsEntity.setOriCntCode(sysCusNationCodeEntity.getCode());
|
|
|
}
|
|
|
- goodsEntity.setGoodsRate(BigDecimal.valueOf(Double.valueOf(goodsDto.getGoodsRate())));
|
|
|
+
|
|
|
+ if(goodsDto.getGoodsRate().indexOf("%") != -1){
|
|
|
+ goodsDto.setGoodsRate(goodsDto.getGoodsRate().substring(0, goodsDto.getGoodsRate().indexOf("%")));
|
|
|
+ }
|
|
|
+
|
|
|
+ goodsEntity.setGoodsRate(BigDecimal.valueOf(Double.valueOf(goodsDto.getGoodsRate())).divide(new BigDecimal(100), 4, BigDecimal.ROUND_HALF_UP));
|
|
|
+ retailPrice = BigDecimal.valueOf(Double.valueOf(goodsDto.getRetailPrice())).divide(goodsEntity.getGoodsRate().add(new BigDecimal(1)), 2, BigDecimal.ROUND_HALF_UP);
|
|
|
+ }else{
|
|
|
+ retailPrice = BigDecimal.valueOf(Double.valueOf(goodsDto.getGoodsRate())).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
}
|
|
|
+
|
|
|
+ goodsEntity.setRetailPrice(retailPrice);
|
|
|
goodsEntity.setIsOnSale(Integer.parseInt(goodsDto.getIsOnSaleStr()));
|
|
|
goodsEntity.setIsHot(Integer.parseInt(goodsDto.getIsHotStr()));
|
|
|
// goodsEntity.setRetailPrice(BigDecimal.valueOf(Integer.valueOf(goodsDto.getRetailPrice())));
|