This commit is contained in:
parent
7597ea905f
commit
c0bb92fd75
|
|
@ -242,10 +242,14 @@ public class TypeServiceImpl implements ITypeService {
|
||||||
BigDecimal storageNum = BigDecimal.ZERO;;
|
BigDecimal storageNum = BigDecimal.ZERO;;
|
||||||
// 查询库存
|
// 查询库存
|
||||||
if (info != null) {
|
if (info != null) {
|
||||||
if ("1".equals(info.getManageType())) {
|
if ("3".equals(type.getStyle()) && type.getPreStoreNum() != null){
|
||||||
storageNum = typeMapper.getStorageNumByTypeId(type);
|
storageNum= type.getPreStoreNum();
|
||||||
} else {
|
} else {
|
||||||
storageNum = typeMapper.getMaCodeNum(type);
|
if ("1".equals(info.getManageType())) {
|
||||||
|
storageNum = typeMapper.getStorageNumByTypeId(type);
|
||||||
|
} else {
|
||||||
|
storageNum = typeMapper.getMaCodeNum(type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.material.ma.domain.*;
|
import com.bonus.material.ma.domain.*;
|
||||||
import com.bonus.material.ma.domain.vo.ExceptionEnum;
|
import com.bonus.material.ma.domain.vo.ExceptionEnum;
|
||||||
import com.bonus.material.ma.domain.vo.GlobalContants;
|
import com.bonus.material.ma.domain.vo.GlobalContants;
|
||||||
|
import com.bonus.material.ma.mapper.TypeMapper;
|
||||||
import com.bonus.material.ma.mapper.WarehousingMapper;
|
import com.bonus.material.ma.mapper.WarehousingMapper;
|
||||||
import com.bonus.material.ma.service.ITypeService;
|
import com.bonus.material.ma.service.ITypeService;
|
||||||
import com.bonus.material.ma.service.WarehousingService;
|
import com.bonus.material.ma.service.WarehousingService;
|
||||||
|
|
@ -41,6 +42,9 @@ public class WarehousingServiceImpl implements WarehousingService {
|
||||||
@Resource
|
@Resource
|
||||||
private ITypeService typeService;
|
private ITypeService typeService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TypeMapper typeMapper;
|
||||||
|
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private PurchaseInputMapper purchaseInputMapper;
|
// private PurchaseInputMapper purchaseInputMapper;
|
||||||
|
|
||||||
|
|
@ -173,17 +177,11 @@ public class WarehousingServiceImpl implements WarehousingService {
|
||||||
machIneDto.setInfoId(machIneDto.getId());
|
machIneDto.setInfoId(machIneDto.getId());
|
||||||
}
|
}
|
||||||
for (int i = 0; i < dto.getMachIneDtoList().size(); i++) {
|
for (int i = 0; i < dto.getMachIneDtoList().size(); i++) {
|
||||||
|
//查询库存
|
||||||
|
Type type1 = new Type();
|
||||||
|
type1.setTypeId(Long.valueOf(dto.getTypeId()));
|
||||||
|
BigDecimal storageNum = typeMapper.getMaCodeNum(type1);
|
||||||
MachIneDto machIneDto = dto.getMachIneDtoList().get(i);
|
MachIneDto machIneDto = dto.getMachIneDtoList().get(i);
|
||||||
//根据类型追加ma_type表里面的num
|
|
||||||
Type type = new Type();
|
|
||||||
type.setModelTitle("盘点入库");
|
|
||||||
type.setCode(code);
|
|
||||||
type.setStyle("3");
|
|
||||||
type.setTypeId(Long.parseLong(machIneDto.getTypeId()));
|
|
||||||
type.setInputNum(BigDecimal.ONE);
|
|
||||||
type.setMaId(machIneDto.getMaId());
|
|
||||||
type.setMaCode(machIneDto.getMaCode());
|
|
||||||
res += typeService.updateNumAddOrSubtract(type);
|
|
||||||
machIneDto.setCode(code);
|
machIneDto.setCode(code);
|
||||||
machIneDto.setIsCode(dto.getIsCode());
|
machIneDto.setIsCode(dto.getIsCode());
|
||||||
machIneDto.setTypeId(dto.getTypeId());
|
machIneDto.setTypeId(dto.getTypeId());
|
||||||
|
|
@ -193,6 +191,18 @@ public class WarehousingServiceImpl implements WarehousingService {
|
||||||
machIneDto.setCheckMan(dto.getCheckMan());
|
machIneDto.setCheckMan(dto.getCheckMan());
|
||||||
machIneDto.setInfoId(dto.getMachIneDtoList().get(0).getInfoId());
|
machIneDto.setInfoId(dto.getMachIneDtoList().get(0).getInfoId());
|
||||||
res += insertMachineInfo(machIneDto);
|
res += insertMachineInfo(machIneDto);
|
||||||
|
|
||||||
|
//根据类型追加ma_type表里面的num
|
||||||
|
Type type = new Type();
|
||||||
|
type.setModelTitle("盘点入库");
|
||||||
|
type.setCode(code);
|
||||||
|
type.setStyle("3");
|
||||||
|
type.setPreStoreNum(storageNum);
|
||||||
|
type.setTypeId(Long.parseLong(machIneDto.getTypeId()));
|
||||||
|
type.setInputNum(BigDecimal.ONE);
|
||||||
|
type.setMaId(machIneDto.getMaId());
|
||||||
|
type.setMaCode(machIneDto.getMaCode());
|
||||||
|
res += typeService.updateNumAddOrSubtract(type);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue