|
|
@@ -134,8 +134,23 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
|
public List<InOutRecordVO> setInOutRecordMessageByOut(List<InOutRecordVO> inOutRecordVOList) {
|
|
|
+ //region 查询当前公司的系统参数 自动办理信息 并赋值
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("cpId", inOutRecordVOList.get(0).getCpId());
|
|
|
+ map.put("code",Constant.SystemConstant.IVT_002.getValue());
|
|
|
+ //负数标识1
|
|
|
+ String flgHandleSetting = commonMapper.getSettingValue(map);
|
|
|
+ //endregion
|
|
|
//赋值
|
|
|
for (InOutRecordVO inOutRecordVO : inOutRecordVOList) {
|
|
|
+ //负数标识1 可以
|
|
|
+ if (Constant.FlgAutoHandleStringType.ONE.getValue().equals(flgHandleSetting)) {
|
|
|
+ inOutRecordVO.setCanNegativeFlag(true);
|
|
|
+ }
|
|
|
+ //不可以
|
|
|
+ else{
|
|
|
+ inOutRecordVO.setCanNegativeFlag(false);
|
|
|
+ }
|
|
|
//业务单据
|
|
|
inOutRecordVO.setBiznisType(Constant.InventoryDocCode.OUTBOUND.getTableName());
|
|
|
//业务单ID
|
|
|
@@ -186,22 +201,7 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
if (inOutRecordVOList.size() == 0) {
|
|
|
throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.DETAIL_LIST_IS_NUL.getMessage());
|
|
|
}
|
|
|
- //region 查询当前公司的系统参数 自动办理信息 并赋值
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
- map.put("cpId", inOutRecordVOList.get(0).getCpId());
|
|
|
- map.put("code",Constant.SystemConstant.IVT_002.getValue());
|
|
|
- //负数标识1
|
|
|
- String flgHandleSetting = commonMapper.getSettingValue(map);
|
|
|
- //endregion
|
|
|
for (InOutRecordVO inventoryBatchVO : inOutRecordVOList) {
|
|
|
- //负数标识1 可以
|
|
|
- if (Constant.FlgAutoHandleStringType.ONE.getValue().equals(flgHandleSetting)) {
|
|
|
- inventoryBatchVO.setCanNegativeFlag(true);
|
|
|
- }
|
|
|
- //不可以
|
|
|
- else{
|
|
|
- inventoryBatchVO.setCanNegativeFlag(false);
|
|
|
- }
|
|
|
//商品ID
|
|
|
if (inventoryBatchVO.getSkuId() == null || "".equals(inventoryBatchVO.getSkuId())) {
|
|
|
throw new BaseBusinessException(ResponseCodeEnum.OPERATE_FAIL.getCode(), ErrorCodeEnum.SKU_IS_NULL.getMessage());
|
|
|
@@ -323,7 +323,6 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
}
|
|
|
//endregion
|
|
|
|
|
|
-
|
|
|
//region 判断是库位调整还是其他类型操作库存然后走对应的逻辑
|
|
|
//库位移动
|
|
|
if (Constant.InventoryDocCode.MOVE.getValue().equals(inventoryDocCode)) {
|
|
|
@@ -358,6 +357,7 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
+
|
|
|
//region 删除
|
|
|
else {
|
|
|
//入库
|
|
|
@@ -1122,6 +1122,7 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
rollbackFor = {Exception.class}
|
|
|
)
|
|
|
public void updateInventoryMessageDelete(InventoryResponse inventoryResponse, InOutRecordVO inOutRecordVO) {
|
|
|
+
|
|
|
//region 根据库存id查询库存批次明细 汇总金额
|
|
|
List<InventoryBatchResponse> inventoryBatchResponseList = inventoryBatchMapper.selectAmountAndQuantity(new InventoryBatchQuery().setInvId(inventoryResponse.getInvId()));
|
|
|
//库存资产汇总 ---库存需要
|
|
|
@@ -1348,7 +1349,6 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
inOutRecordMapper.deleteData(inOutRecord);
|
|
|
//endregion
|
|
|
|
|
|
-
|
|
|
//region 要把出库成本也删除
|
|
|
OutboundItemCost outboundItemCost = new OutboundItemCost();
|
|
|
//出库明细Id
|
|
|
@@ -1356,7 +1356,6 @@ public class InventoryService extends BaseService<Inventory> {
|
|
|
outboundItemCostMapper.deleteData(inOutRecord);
|
|
|
//endregion
|
|
|
|
|
|
-
|
|
|
//新建存货流水 一正一负
|
|
|
this.insertInboundRecord(inOutRecordVO);
|
|
|
//新建出库成本
|