优化库存逻辑和单据sku
This commit is contained in:
@@ -281,8 +281,7 @@ public class DepotHeadService {
|
||||
//更新当前库存
|
||||
List<DepotItem> list = depotItemService.getListByHeaderId(id);
|
||||
for (DepotItem depotItem : list) {
|
||||
Long tenantId = redisService.getTenantId(request);
|
||||
depotItemService.updateCurrentStock(depotItem, tenantId);
|
||||
depotItemService.updateCurrentStock(depotItem);
|
||||
}
|
||||
/**删除单据主表信息*/
|
||||
batchDeleteDepotHeadByIds(id.toString());
|
||||
@@ -611,7 +610,7 @@ public class DepotHeadService {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void addDepotHeadAndDetail(String beanJson, String rows, Long tenantId,
|
||||
public void addDepotHeadAndDetail(String beanJson, String rows,
|
||||
HttpServletRequest request) throws Exception {
|
||||
/**处理单据主表数据*/
|
||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||
@@ -668,7 +667,7 @@ public class DepotHeadService {
|
||||
if(list!=null) {
|
||||
Long headId = list.get(0).getId();
|
||||
/**入库和出库处理单据子表信息*/
|
||||
depotItemService.saveDetials(rows,headId,tenantId, request);
|
||||
depotItemService.saveDetials(rows,headId, request);
|
||||
}
|
||||
/**如果关联单据号非空则更新订单的状态为2 (只操作采购订单和销售订单) */
|
||||
if(depotHead.getLinkNumber()!=null) {
|
||||
@@ -696,7 +695,7 @@ public class DepotHeadService {
|
||||
* @throws Exception
|
||||
*/
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public void updateDepotHeadAndDetail(String beanJson, String rows, Long tenantId,HttpServletRequest request)throws Exception {
|
||||
public void updateDepotHeadAndDetail(String beanJson, String rows,HttpServletRequest request)throws Exception {
|
||||
/**更新单据主表信息*/
|
||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||
//获取之前的金额数据
|
||||
@@ -742,7 +741,7 @@ public class DepotHeadService {
|
||||
}
|
||||
}
|
||||
/**入库和出库处理单据子表信息*/
|
||||
depotItemService.saveDetials(rows,depotHead.getId(),tenantId,request);
|
||||
depotItemService.saveDetials(rows,depotHead.getId(),request);
|
||||
logService.insertLog("单据",
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(depotHead.getNumber()).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
|
||||
Reference in New Issue
Block a user