Commit 4cbb94ad by 李小惠

Merge branch 'develop' of http://gitlab.sothing.top/843502640/jyzb_platformV2 into develop-lxh

parents 6a3e641c 1e2b97bc
......@@ -12,6 +12,7 @@ public enum InventoryExceptionEnum implements IExceptionEnum {
BROKENNUM_BEYOND_STOCK(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"审核中的数量已存在最大可报废数量,现提交失败"),
ORDER_NOT_EXIST(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"盘点单据不存在"),
ORDER_HAS_START(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"单据已经开始,请勿重复操作"),
RUNNINGORDER_EXIST(CommonConstant.DEFAULT_BIZ_ERROR_CODE,"已存在盘点单据"),
/**
* 装备不存在
*/
......
......@@ -44,7 +44,7 @@ public class Warehouse implements Serializable {
private Long orgId;
@TableField("is_locked")
private Boolean isLocked;
private Integer isLocked;
@TableField("sum")
private Integer sum;
......
......@@ -316,8 +316,21 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean Start(UploadInventoryReq req) {
String orderId=req.getOrderId();
BussinessInventory bi= this.getById(orderId);
BussinessInventory biexist=this.getOne(new LambdaQueryWrapper<BussinessInventory>()
.eq(BussinessInventory::getWarehouseId, bi.getWarehouseId())
.eq(BussinessInventory::getInventoryState,"running"));
if (biexist!=null)
{
throw new ServiceException(InventoryExceptionEnum.RUNNINGORDER_EXIST);
}
Warehouse warehouse= warehouseService.getById(bi.getWarehouseId());
warehouse.setIsLocked(1);
if (bi.getInventoryState().equals("running"))
{
throw new ServiceException(InventoryExceptionEnum.ORDER_HAS_START);
......@@ -332,7 +345,7 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
BDList.add(bdInsert);
}
bussinessInventoryDetailService.saveBatch(BDList);
warehouseService.updateById(warehouse);
if (bi!=null)
{
bi.setInventoryState("running");
......@@ -433,7 +446,6 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
public Boolean UseOrFinished(UploadInventoryReq req) {
//更新之前先把库存表的epc备份
BussinessInventory BI= this.getById(req.getOrderId());
List<BussinessDetail> details;
List<WarehouseInventory> DeleteList;
List<WarehouseInventory> UpdateList;
List<BussinessDetail> BusinessDetail = bussinessInventoryDetailService.list(
......@@ -502,6 +514,11 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
BI.setUpdateTime(DateTimeUtil.getCurrentDateTime());
this.updateById(BI);
inventorySummaryService.updateBatchById(SumResult);
Warehouse warehouse= warehouseService.getById(BI.getWarehouseId());
warehouse.setIsLocked(0);
warehouseService.updateById(warehouse);
// }
// else if (req.getState().equals("1"))//回滚结果
// {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论