新增调拨单批量添加明细

master
maxw@mesnac.com 7 days ago
parent 7fd415def9
commit 73aa065843

@ -76,7 +76,7 @@ public class WmsAllocateOrderDetailController extends BaseController {
@Log(title = "调拨子", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsAllocateOrderDetailBo bo) {
public R<Void> add( @RequestBody List<WmsAllocateOrderDetailBo> bo) {
return toAjax(wmsAllocateOrderDetailService.insertByBo(bo));
}

@ -47,7 +47,7 @@ public interface IWmsAllocateOrderDetailService {
* @param bo
* @return
*/
Boolean insertByBo(WmsAllocateOrderDetailBo bo);
Boolean insertByBo(List<WmsAllocateOrderDetailBo> bo);
/**
*

@ -15,9 +15,7 @@ import org.dromara.wms.mapper.WmsAllocateOrderDetailMapper;
import org.dromara.wms.service.IWmsAllocateOrderDetailService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
import java.util.*;
/**
* Service
@ -88,13 +86,17 @@ public class WmsAllocateOrderDetailServiceImpl implements IWmsAllocateOrderDetai
* @return
*/
@Override
public Boolean insertByBo(WmsAllocateOrderDetailBo bo) {
WmsAllocateOrderDetail add = MapstructUtils.convert(bo, WmsAllocateOrderDetail.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setAoDId(add.getAoDId());
public Boolean insertByBo(List<WmsAllocateOrderDetailBo> bo) {
ArrayList<WmsAllocateOrderDetail> list = new ArrayList<>();
for (WmsAllocateOrderDetailBo detailBo : bo) {
WmsAllocateOrderDetail add = MapstructUtils.convert(detailBo, WmsAllocateOrderDetail.class);
list.add(add);
}
boolean flag = baseMapper.insertBatch(list);
// if (flag) {
// bo.setAoDId(add.getAoDId());
// }
return flag;
}

Loading…
Cancel
Save