银甲申请

liweidong
liweidong-hj 4 days ago
parent d655d3657f
commit 175e64368d
  1. 38
      blade-service/blade-desk/src/main/java/org/springblade/desk/order/service/impl/PlateGoodsRecordServiceImpl.java
  2. 1
      blade-service/blade-desk/src/main/java/org/springblade/desk/order/service/impl/YieldOrderServiceImpl.java

@ -101,8 +101,30 @@ public class PlateGoodsRecordServiceImpl extends BaseServiceImpl<PlateGoodsRecor
@Override
public boolean save(PlateGoodsRecord entity, List<PlateGoodsRecordDetail> detailList) {
String goodsCode = entity.getGoodsCode();
BigDecimal silverPotassium = entity.getSilverPotassium();
BigDecimal coefficient = entity.getCoefficient();
BigDecimal sunGoodsDemand = entity.getGoodsDemand();
if (goodsCode.equals(PlateGoodsConst.SILVER_PLATE) && silverPotassium.compareTo(BigDecimal.ZERO) > 0) {
BigDecimal silverPotassiumProduct = silverPotassium.multiply(coefficient);
if (sunGoodsDemand.subtract(silverPotassiumProduct).compareTo(BigDecimal.ZERO) >= 0) {
sunGoodsDemand = sunGoodsDemand.subtract(silverPotassiumProduct);
} else {
throw new ServiceException("上报银钾转换后大于银板需求数,请减小上报银钾数");
}
entity.setSilverPotassium(silverPotassium);
entity.setSilverPotassiumResidue(silverPotassium.doubleValue());
entity.setCoefficient(coefficient);
}
entity.setGoodsDemand(sunGoodsDemand);
entity.setSurplus(sunGoodsDemand);
entity.setDemandCode(generateCode());
entity.setSurplus(entity.getGoodsDemand());
entity.setStatus(PlateGoodsEnum.STATUS_WAITING.getCode());
entity.setApprovalStatus(PlateGoodsEnum.STATUS_WAITING.getCode());
if (StringUtils.isEmpty(entity.getGoodsName())) {
@ -492,6 +514,20 @@ public class PlateGoodsRecordServiceImpl extends BaseServiceImpl<PlateGoodsRecor
);
plateGoodsRecord.setGoodsBoId(goodsBoId);
//判定银钾有值一起单独申报
if (plateGoodsRecord.getSilverPotassium() != null && plateGoodsRecord.getSilverPotassium().compareTo(BigDecimal.ZERO) > 0) {
Long CoefficientBoId = wmsTaskClient.buyOrderApply(
PlateGoodsConst.SILVER_POTASSIUM,
plateGoodsRecord.getSilverPotassium().doubleValue(),
plateGoodsRecord.getCreateUser(),
plateGoodsRecord.getCreateTime(),
user.getUserId(),
plateGoodsRecord.getUpdateTime()
);
plateGoodsRecord.setCoefficientBoId(CoefficientBoId);
}
} catch (Exception e) {
log.error("调用ERP失败,id:{}", id, e);
throw new ServiceException("调用ERP接口失败:" + e.getMessage());

@ -262,6 +262,7 @@ public class YieldOrderServiceImpl extends BaseServiceImpl<YieldOrderMapper, Yie
entity.setStatus(YieldOrderEnum.STATUS_APS.getCode());
List<YieldOrder> dataList = baseMapper.selectPage(page, entity, yieldTypeList);
// 获取所有父订单ID
List<Long> idList = dataList.stream()
.map(YieldOrder::getId)

Loading…
Cancel
Save