新增关联

liweidong
liweidong-hj 2 weeks ago
parent dc611088ae
commit 0424de106f
  1. 18
      blade-service/blade-desk/src/main/java/org/springblade/desk/order/service/impl/PlateGoodsApplyServiceImpl.java

@ -13,13 +13,11 @@ import org.springblade.core.tool.utils.Func;
import org.springblade.desk.order.mapper.PlateGoodsApplyMapper; import org.springblade.desk.order.mapper.PlateGoodsApplyMapper;
import org.springblade.desk.order.pojo.entity.AssayContentDetail; import org.springblade.desk.order.pojo.entity.AssayContentDetail;
import org.springblade.desk.order.pojo.entity.PlateGoodsApply; import org.springblade.desk.order.pojo.entity.PlateGoodsApply;
import org.springblade.desk.order.pojo.entity.PlateGoodsApplyDetail;
import org.springblade.desk.order.pojo.entity.PlateGoodsRecord; import org.springblade.desk.order.pojo.entity.PlateGoodsRecord;
import org.springblade.desk.order.pojo.enums.AssayContentEnum; import org.springblade.desk.order.pojo.enums.AssayContentEnum;
import org.springblade.desk.order.pojo.enums.PlateGoodsEnum; import org.springblade.desk.order.pojo.enums.PlateGoodsEnum;
import org.springblade.desk.order.service.IAssayContentDetailService; import org.springblade.desk.order.service.*;
import org.springblade.desk.order.service.IAssayContentService;
import org.springblade.desk.order.service.IPlateGoodsApplyService;
import org.springblade.desk.order.service.IPlateGoodsRecordService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -40,6 +38,7 @@ public class PlateGoodsApplyServiceImpl extends BaseServiceImpl<PlateGoodsApplyM
private final IAssayContentService assayContentService; private final IAssayContentService assayContentService;
private final IAssayContentDetailService assayContentDetailService; private final IAssayContentDetailService assayContentDetailService;
private final IPlateGoodsRecordService goodsRecordService; private final IPlateGoodsRecordService goodsRecordService;
private final IPlateGoodsApplyDetailService goodsApplyDetailService;
@Override @Override
public IPage<PlateGoodsApply> selectPage(IPage<PlateGoodsApply> page, PlateGoodsApply entity) { public IPage<PlateGoodsApply> selectPage(IPage<PlateGoodsApply> page, PlateGoodsApply entity) {
@ -176,6 +175,17 @@ public class PlateGoodsApplyServiceImpl extends BaseServiceImpl<PlateGoodsApplyM
goodsRecordService.updateBatchById(addRecordList); goodsRecordService.updateBatchById(addRecordList);
this.save(apply); this.save(apply);
//关联订单
List<PlateGoodsApplyDetail> goodsApplyDetailList = new ArrayList<>();
for (PlateGoodsRecord goodsRecord : addRecordList) {
PlateGoodsApplyDetail plateGoodsApplyDetail = new PlateGoodsApplyDetail();
plateGoodsApplyDetail.setPgaId(apply.getId());
plateGoodsApplyDetail.setPgrId(goodsRecord.getId());
goodsApplyDetailList.add(plateGoodsApplyDetail);
}
goodsApplyDetailService.saveBatch(goodsApplyDetailList);
return true; return true;
} }

Loading…
Cancel
Save