|
@@ -7,7 +7,6 @@ import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.*;
|
|
|
import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
-import com.ym.mec.biz.dal.dto.GoodsBatchNoDto;
|
|
|
import com.ym.mec.biz.dal.dto.GoodsSellDto;
|
|
|
import com.ym.mec.biz.dal.dto.RepairGoodsDto;
|
|
|
import com.ym.mec.biz.dal.entity.*;
|
|
@@ -262,7 +261,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
List<GoodsSellDto> goodsSellDtos = JSONObject.parseArray(studentGoodsSell.getGoodsJson(),GoodsSellDto.class);
|
|
|
List<Integer> goodsIds = goodsSellDtos.stream().map(e -> e.getGoodsId()).collect(Collectors.toList());
|
|
|
|
|
|
- Map<Integer, BigDecimal> map = getMap("goods", "id_", "market_price_", goodsIds, Integer.class, BigDecimal.class);
|
|
|
+ Map<Integer, BigDecimal> map = getMap("goods", "id_", "discount_price_", goodsIds, Integer.class, BigDecimal.class);
|
|
|
for (GoodsSellDto goodsSellDto : goodsSellDtos) {
|
|
|
goodsSellDto.setGoodsPrice(map.get(goodsSellDto.getGoodsId()));
|
|
|
goodsSellDto.setTotalGoodsPrice(map.get(goodsSellDto.getGoodsId()).multiply(new BigDecimal(goodsSellDto.getGoodsNum())));
|
|
@@ -828,7 +827,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
//获取比例
|
|
|
BigDecimal ratioAmount = sellDto.getTotalGoodsPrice().divide(divide, 6, BigDecimal.ROUND_HALF_UP);
|
|
|
|
|
|
- if(addTotalPrice.doubleValue() > 0l){
|
|
|
+ if(addTotalPrice != null && addTotalPrice.doubleValue() > 0l){
|
|
|
//如果是最后一件商品
|
|
|
if(i == integers.size() - 1){
|
|
|
sellDto.setTotalGoodsPrice(sellDto.getTotalGoodsPrice().add(usableParentGoodsAddTotalPrice));
|
|
@@ -839,7 +838,7 @@ public class StudentRepairServiceImpl extends BaseServiceImpl<Integer, StudentRe
|
|
|
usableParentGoodsAddTotalPrice = usableParentGoodsAddTotalPrice.subtract(multiply);
|
|
|
}
|
|
|
sellDto.setGoodsPrice(sellDto.getTotalGoodsPrice());
|
|
|
- }else if(cutTotalPrice.doubleValue() > 0l){
|
|
|
+ }else if(cutTotalPrice != null && cutTotalPrice.doubleValue() > 0l){
|
|
|
//如果是最后一件商品
|
|
|
if(i == integers.size() - 1){
|
|
|
sellDto.setTotalGoodsPrice(sellDto.getTotalGoodsPrice().subtract(usableParentGoodsCutTotalPrice));
|