diff --git a/src/main/java/com/dev/swms/server/service/inventory/InventoryManager.java b/src/main/java/com/dev/swms/server/service/inventory/InventoryManager.java index 590a13b..7726202 100644 --- a/src/main/java/com/dev/swms/server/service/inventory/InventoryManager.java +++ b/src/main/java/com/dev/swms/server/service/inventory/InventoryManager.java @@ -15,6 +15,7 @@ import com.dev.swms.server.model.base.PackageUnit; import com.dev.swms.server.model.base.Warehouse; import com.dev.swms.server.model.count.CountRecord; import com.dev.swms.server.model.inventory.Inventory; +import com.dev.swms.server.model.inventory.InventoryLog; import com.dev.swms.server.model.inventory.ItemKeyInventory; import com.dev.swms.server.model.inventory.ProcessDoc; import com.dev.swms.server.model.inventory.ProductInventory; @@ -300,4 +301,16 @@ public interface InventoryManager extends BaseManager{ @Transactional void recordLog(String logType, int incOrDec,String relatedBill,BillType billType,Location location,String LP,ItemKey itemKey, Date storageDate,String soi,double occurQuantity,PackageUnit unit,String status,Long referenceLog,String description); + + /** + * 库内移位提交 + * @param ids + */ + @Transactional + void moveTj(long inventoryId,String tjBz); + + @Transactional + InventoryLog addInventoryLog(String logType, int incOrDec, String relatedBill, Location location, + String LP, ItemKey itemKey, Date storageDate, String soi, double occurQuantity, PackageUnit unit, + String status, Long referenceLog, String description, BillType billType) ; } diff --git a/src/main/java/com/dev/swms/server/service/inventory/pojo/DefaultInventoryManager.java b/src/main/java/com/dev/swms/server/service/inventory/pojo/DefaultInventoryManager.java index 2bdf76c..34e20be 100644 --- a/src/main/java/com/dev/swms/server/service/inventory/pojo/DefaultInventoryManager.java +++ b/src/main/java/com/dev/swms/server/service/inventory/pojo/DefaultInventoryManager.java @@ -75,6 +75,7 @@ import com.dev.energy.server.exception.BusinessException; import com.dev.energy.server.model.EntityFactory; import com.dev.energy.server.service.pojo.DefaultBaseManager; import com.dev.energy.server.util.LocalizedMessage; +import com.dev.energy.server.web.security.UserHolder; /** * @author dev @@ -129,7 +130,7 @@ public class DefaultInventoryManager extends DefaultBaseManager implements Inven * @param description 备注 * @param billType 相关单据类型 */ - private InventoryLog addInventoryLog(String logType, int incOrDec, String relatedBill, Location location, + public InventoryLog addInventoryLog(String logType, int incOrDec, String relatedBill, Location location, String LP, ItemKey itemKey, Date storageDate, String soi, double occurQuantity, PackageUnit unit, String status, Long referenceLog, String description, BillType billType) { InventoryLog log = new InventoryLog(logType, incOrDec, relatedBill, billType, location, LP, itemKey, @@ -500,6 +501,10 @@ public class DefaultInventoryManager extends DefaultBaseManager implements Inven throw new BusinessException("location.lp.refused"); } + /*if(srcInv.getTjDate()==null){ + throw new BusinessException("库内移位未提交,不允许移位!"); + }*/ + //目标库位不混放,验证目标库位是否有库存 if(!dstLoc.isMixItem()){ String hql=" from Inventory inv where inv.location.id="+destLocationId+" and inv.quantity>0 "; @@ -2613,5 +2618,14 @@ public class DefaultInventoryManager extends DefaultBaseManager implements Inven commonDao.store(log); } + + @Override + public void moveTj(long inventoryId,String tjBz) { + /*Inventory inv=this.load(Inventory.class, inventoryId); + inv.setTjr(UserHolder.getUser().getName()); + inv.setTjDate(new Date()); + inv.setTjBz(tjBz); + commonDao.store(inv);*/ + } } \ No newline at end of file diff --git a/src/main/java/com/dev/swms/server/service/picking/pojo/DefaultMasterBolManager.java b/src/main/java/com/dev/swms/server/service/picking/pojo/DefaultMasterBolManager.java index ef3dd84..cf24638 100644 --- a/src/main/java/com/dev/swms/server/service/picking/pojo/DefaultMasterBolManager.java +++ b/src/main/java/com/dev/swms/server/service/picking/pojo/DefaultMasterBolManager.java @@ -593,6 +593,11 @@ public class DefaultMasterBolManager extends DefaultBaseManager implements Maste inv.setVolume(log.getVolume()); inv.setItemKey(log.getItemKey()); commonDao.store(inv); + //添加库存日志 + inventoryManager.addInventoryLog(InventoryLogType.MOVE, 1, null, + inv.getLocation(), (inv.getLP()==null?null:inv.getLP().getLP()), + inv.getItemKey(), inv.getStorageDate(), + inv.getSOI(), inv.getQuantity(), inv.getPackageUnit(), inv.getStatus(), null, null, null); } updatePreAllocate(pt.getId()); updatePickTicketQuantity(pt.getId()); diff --git a/src/webapp/WEB-INF/classes/config/origen/customs/orderFB/maintainFBTransInvPage.xml b/src/webapp/WEB-INF/classes/config/origen/customs/orderFB/maintainFBTransInvPage.xml index 80fa83f..29952a0 100644 --- a/src/webapp/WEB-INF/classes/config/origen/customs/orderFB/maintainFBTransInvPage.xml +++ b/src/webapp/WEB-INF/classes/config/origen/customs/orderFB/maintainFBTransInvPage.xml @@ -66,7 +66,7 @@ WHERE 1=1 and inventory.SOI={invoiceBox.customsOrder.code} and inventory.beTransfer is null - and location.code='中转库位' + and location.code='AQNZZDJQ' and inventory.qtyOfMasterPack > 0 and inventory.warehouse=#{SESSION_WAREHOUSE} and (company.id in (select u.organization.id from UserOrganize u where u.user=#{SESSION_USERS})