|
|
|
@ -9,21 +9,16 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
|
|
|
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
|
|
|
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;
|
|
|
|
|
import org.dromara.wms.domain.bo.WmsInstockDetailBo;
|
|
|
|
|
import org.dromara.wms.domain.bo.WmsInstockPrintBo;
|
|
|
|
|
import org.dromara.wms.domain.vo.BaseMaterialInfoVo;
|
|
|
|
|
import org.dromara.wms.domain.vo.WmsInstockDetailVo;
|
|
|
|
|
import org.dromara.wms.domain.vo.WmsInstockOrderVo;
|
|
|
|
|
import org.dromara.wms.mapper.WmsInstockDetailMapper;
|
|
|
|
|
import org.dromara.wms.service.IBaseMaterialInfoService;
|
|
|
|
|
import org.dromara.wms.service.IWmsInstockDetailService;
|
|
|
|
|
import org.dromara.wms.service.IWmsInstockOrderService;
|
|
|
|
|
import org.dromara.wms.service.IWmsInstockPrintService;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
@ -31,7 +26,6 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.Collection;
|
|
|
|
@ -75,7 +69,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
@Override
|
|
|
|
|
public TableDataInfo<WmsInstockDetailVo> queryPageList(WmsInstockDetailBo bo, PageQuery pageQuery) {
|
|
|
|
|
MPJLambdaWrapper<WmsInstockDetail> lqw = buildQueryWrapper(bo);
|
|
|
|
|
lqw.orderByDesc(WmsInstockDetail::getCreateTime);
|
|
|
|
|
// lqw.orderByDesc(WmsInstockDetail::getCreateTime);
|
|
|
|
|
Page<WmsInstockDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
|
|
|
|
return TableDataInfo.build(result);
|
|
|
|
|
}
|
|
|
|
@ -128,7 +122,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean insertByBo(List<WmsInstockDetailBo> bo) {
|
|
|
|
|
ArrayList<WmsInstockDetail> list = new ArrayList<>();
|
|
|
|
|
// ArrayList<WmsInstockDetail> list = new ArrayList<>();
|
|
|
|
|
int a = 0;
|
|
|
|
|
String username = LoginHelper.getUsername();
|
|
|
|
|
for (WmsInstockDetailBo detailBo : bo) {
|
|
|
|
@ -159,7 +153,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
if (bo.getPrintNum()==null){
|
|
|
|
|
WmsInstockDetail update = MapstructUtils.convert(bo, WmsInstockDetail.class);
|
|
|
|
|
update.setUpdateBy(username);
|
|
|
|
|
validEntityBeforeSave(update);
|
|
|
|
|
// validEntityBeforeSave(update);
|
|
|
|
|
return baseMapper.updateDetail(update)>0;
|
|
|
|
|
}
|
|
|
|
|
if (bo.getPrintedNum()==null){
|
|
|
|
@ -180,7 +174,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
wmsInstockPrint.setApportionQty(bo.getPrintNum());
|
|
|
|
|
wmsInstockPrint.setMaterialQty(bo.getBarcodeNum());
|
|
|
|
|
wmsInstockPrint.setCreateBy(username);
|
|
|
|
|
int rows = wmsInstockPrintService.insertWmsInstockPrint(wmsInstockPrint);
|
|
|
|
|
// int rows = wmsInstockPrintService.insertWmsInstockPrint(wmsInstockPrint);
|
|
|
|
|
WmsInstockDetail wmsInstockDetail = new WmsInstockDetail();
|
|
|
|
|
wmsInstockDetail.setPrintedNum(bo.getPrintedNum().add(bo.getPrintNum()));
|
|
|
|
|
LambdaUpdateWrapper<WmsInstockDetail> updateWrapper = new LambdaUpdateWrapper<>();
|
|
|
|
@ -191,8 +185,7 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
}
|
|
|
|
|
public String generateOrder(Integer value){
|
|
|
|
|
if (value.toString().length()<3){
|
|
|
|
|
String fixedLengthString = String.format("%03d", value);
|
|
|
|
|
return fixedLengthString;
|
|
|
|
|
return String.format("%03d", value);
|
|
|
|
|
}else if (value.toString().length()==3){
|
|
|
|
|
return value.toString();
|
|
|
|
|
}
|
|
|
|
@ -202,9 +195,8 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
/**
|
|
|
|
|
* 保存前的数据校验
|
|
|
|
|
*/
|
|
|
|
|
private void validEntityBeforeSave(WmsInstockDetail entity){
|
|
|
|
|
//TODO 做一些数据校验,如唯一约束
|
|
|
|
|
}
|
|
|
|
|
// private void validEntityBeforeSave(WmsInstockDetail entity){
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public int deleteByInstockId(Collection<Long> ids) {
|
|
|
|
@ -227,9 +219,8 @@ public class WmsInstockDetailServiceImpl implements IWmsInstockDetailService {
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
|
|
|
|
if(isValid){
|
|
|
|
|
//TODO 做一些业务上的校验,判断是否需要校验
|
|
|
|
|
}
|
|
|
|
|
// if(isValid){
|
|
|
|
|
// }
|
|
|
|
|
return baseMapper.deleteByIds(ids) > 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|