|
|
|
@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
|
|
import org.dromara.common.satoken.utils.LoginHelper;
|
|
|
|
|
import org.dromara.wms.domain.*;
|
|
|
|
|
import org.dromara.wms.domain.bo.BaseMaterialInfoBo;
|
|
|
|
|
import org.dromara.wms.domain.bo.WmsAllocateOrderDetailBo;
|
|
|
|
@ -113,6 +114,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
public Boolean insertByBo(List<WmsInstockDetailBo> bo) {
|
|
|
|
|
ArrayList<WmsInstockDetail> list = new ArrayList<>();
|
|
|
|
|
int a = 0;
|
|
|
|
|
String username = LoginHelper.getUsername();
|
|
|
|
|
for (WmsInstockDetailBo detailBo : bo) {
|
|
|
|
|
BaseMaterialInfoBo baseMaterialInfo = new BaseMaterialInfoBo();
|
|
|
|
|
baseMaterialInfo.setMaterialId(detailBo.getMaterialId());
|
|
|
|
@ -122,6 +124,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
add.setMaterialName(baseMaterialInfoVos.get(0).getMaterialName());
|
|
|
|
|
add.setMaterialSpe(baseMaterialInfoVos.get(0).getMaterialSpec());
|
|
|
|
|
add.setUnitName(baseMaterialInfoVos.get(0).getMaterialUnit());
|
|
|
|
|
add.setCreateBy(username);
|
|
|
|
|
a += baseMapper.insert(add);
|
|
|
|
|
}
|
|
|
|
|
return a>0;
|
|
|
|
@ -135,8 +138,10 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean updateByBo(WmsInstockDetailBo bo) {
|
|
|
|
|
String username = LoginHelper.getUsername();
|
|
|
|
|
if (bo.getPrintNum()==null){
|
|
|
|
|
WmsInstockDetail update = MapstructUtils.convert(bo, WmsInstockDetail.class);
|
|
|
|
|
update.setUpdateBy(username);
|
|
|
|
|
validEntityBeforeSave(update);
|
|
|
|
|
return baseMapper.updateDetail(update)>0;
|
|
|
|
|
}
|
|
|
|
@ -154,11 +159,13 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
wmsInstockPrint.setBatchCode(batchCode);
|
|
|
|
|
wmsInstockPrint.setApportionQty(bo.getPrintNum().longValue());
|
|
|
|
|
wmsInstockPrint.setMaterialQty(bo.getBarcodeNum());
|
|
|
|
|
wmsInstockPrint.setCreateBy(username);
|
|
|
|
|
int rows = wmsInstockPrintService.insertWmsInstockPrint(wmsInstockPrint);
|
|
|
|
|
WmsInstockDetail wmsInstockDetail = new WmsInstockDetail();
|
|
|
|
|
wmsInstockDetail.setPrintedNum(bo.getPrintedNum()+bo.getPrintNum());
|
|
|
|
|
LambdaUpdateWrapper<WmsInstockDetail> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
|
updateWrapper.eq(WmsInstockDetail::getInstockDetailId,bo.getInstockDetailId());
|
|
|
|
|
wmsInstockDetail.setUpdateBy(username);
|
|
|
|
|
int update = baseMapper.update(wmsInstockDetail, updateWrapper);
|
|
|
|
|
return update>0;
|
|
|
|
|
}
|
|
|
|
|