Browse Source

BUG修改

master
parent
commit
7e099c3d10
  1. 24
      win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/itemoutlocation/ItemOutLocationServiceImpl.java

24
win-module-eam/win-module-eam-biz/src/main/java/com/win/module/eam/service/itemoutlocation/ItemOutLocationServiceImpl.java

@ -8,12 +8,10 @@ import com.win.module.eam.controller.itemoutlocation.vo.ItemOutLocationExportReq
import com.win.module.eam.controller.itemoutlocation.vo.ItemOutLocationPageReqVO; import com.win.module.eam.controller.itemoutlocation.vo.ItemOutLocationPageReqVO;
import com.win.module.eam.controller.itemoutlocation.vo.ItemOutLocationUpdateReqVO; import com.win.module.eam.controller.itemoutlocation.vo.ItemOutLocationUpdateReqVO;
import com.win.module.eam.controller.transaction.vo.TransactionCreateReqVO; import com.win.module.eam.controller.transaction.vo.TransactionCreateReqVO;
import com.win.module.eam.convert.iteminlocation.ItemInLocationConvert;
import com.win.module.eam.convert.itemoutlocation.ItemOutLocationConvert; import com.win.module.eam.convert.itemoutlocation.ItemOutLocationConvert;
import com.win.module.eam.dal.dataobject.inventorywarning.InventoryWarningDO; import com.win.module.eam.dal.dataobject.inventorywarning.InventoryWarningDO;
import com.win.module.eam.dal.dataobject.item.ItemDO; import com.win.module.eam.dal.dataobject.item.ItemDO;
import com.win.module.eam.dal.dataobject.itemaccounts.ItemAccountsDO; import com.win.module.eam.dal.dataobject.itemaccounts.ItemAccountsDO;
import com.win.module.eam.dal.dataobject.iteminlocation.ItemInLocationDO;
import com.win.module.eam.dal.dataobject.itemoutlocation.ItemOutLocationDO; import com.win.module.eam.dal.dataobject.itemoutlocation.ItemOutLocationDO;
import com.win.module.eam.dal.dataobject.location.LocationDO; import com.win.module.eam.dal.dataobject.location.LocationDO;
import com.win.module.eam.dal.mysql.inventorywarning.InventoryWarningMapper; import com.win.module.eam.dal.mysql.inventorywarning.InventoryWarningMapper;
@ -25,6 +23,7 @@ import com.win.module.eam.enums.itemAccount.ItemAccountStatusEnum;
import com.win.module.eam.enums.transaction.TransactionEnum; import com.win.module.eam.enums.transaction.TransactionEnum;
import com.win.module.eam.enums.transactionType.ProcureStatusEnum; import com.win.module.eam.enums.transactionType.ProcureStatusEnum;
import com.win.module.eam.service.transaction.TransactionService; import com.win.module.eam.service.transaction.TransactionService;
import dm.jdbc.util.StringUtil;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -124,11 +123,30 @@ public class ItemOutLocationServiceImpl implements ItemOutLocationService {
QueryWrapper<InventoryWarningDO> inventoryWarningDOQueryWrapper = new QueryWrapper<>(); QueryWrapper<InventoryWarningDO> inventoryWarningDOQueryWrapper = new QueryWrapper<>();
inventoryWarningDOQueryWrapper.eq("number", number); inventoryWarningDOQueryWrapper.eq("number", number);
inventoryWarningDOQueryWrapper.eq("location_number", locationNumber); inventoryWarningDOQueryWrapper.eq("location_number", locationNumber);
inventoryWarningDOQueryWrapper.ne("procure_status", ProcureStatusEnum.YESPURCHASED.getCode()); // inventoryWarningDOQueryWrapper.ne("procure_status", ProcureStatusEnum.YESPURCHASED.getCode());
List<InventoryWarningDO> inventoryWarningDOList = inventoryWarningMapper.selectList(inventoryWarningDOQueryWrapper); List<InventoryWarningDO> inventoryWarningDOList = inventoryWarningMapper.selectList(inventoryWarningDOQueryWrapper);
if(inventoryWarningDOList.isEmpty()){ if(inventoryWarningDOList.isEmpty()){
//数据为空时 直接插入记录
inventoryWarningDO.setCreateTime(LocalDateTime.now()); inventoryWarningDO.setCreateTime(LocalDateTime.now());
result = inventoryWarningMapper.insert(inventoryWarningDO); result = inventoryWarningMapper.insert(inventoryWarningDO);
}else{
//存在一条记录是 判断是否为已完成的记录
if(inventoryWarningDOList.size()==1){
if(StringUtil.isNotEmpty(inventoryWarningDOList.get(0).getProcureStatus())
&& ProcureStatusEnum.YESPURCHASED.getCode().equals(inventoryWarningDOList.get(0).getProcureStatus())){
result = inventoryWarningMapper.insert(inventoryWarningDO);
}
}
//存在多条记录是 判断是否都为已完成的状态
Boolean res = false;
for (InventoryWarningDO warningDO : inventoryWarningDOList) {
if(!ProcureStatusEnum.YESPURCHASED.getCode().equals(warningDO.getProcureStatus())){
res=true;
}
}
if(inventoryWarningDOList.size()>1&&res==false){
result = inventoryWarningMapper.insert(inventoryWarningDO);
}
} }
} }
return result; return result;

Loading…
Cancel
Save