| | |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import java.util.Arrays; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | |
| | | Map<String, Integer> procureModelMap = new HashMap<>(); |
| | | |
| | | for (Object key : groupByModelIdMap.keySet()) { |
| | | Long modelTotalPrice = 0l; |
| | | Long modelTotalPrice = 0L; |
| | | //要报废的总数量 |
| | | int modelTotalNum = 0; |
| | | |
| | |
| | | Object warehouseModelLockObj = LockManage.acquireLock(warehouseType, warehouseId, baseGoodsModelsId); |
| | | int goodsModelNum = 0; |
| | | synchronized (warehouseModelLockObj) { |
| | | goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseType, warehouseId, baseGoodsModelsId, 2, null); |
| | | List<Long> warehouseIds = new ArrayList<>(Arrays.asList(warehouseId)); |
| | | goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseType, warehouseIds, baseGoodsModelsId, 2, null); |
| | | for (Map<String, Object> depFormScrappedModel : eachFfModelList) { |
| | | // 调拨单信息 |
| | | Long transBusinessId = (Long) depFormScrappedModel.get("TRANS_BUSINESS_ID"); |
| | |
| | | } |
| | | goodsBaseService.execBatchUpdate("update DEP_FORM_SCRAPPED_MODEL set TOTAL_AMOUNT=? where id=?", parameterList); |
| | | |
| | | //分发物品使用人【L_WH_PROCURE_MODEL_USER】 中 根据id 更新 在用数量(USE_COUNT) |
| | | //如果是A类物品,则更新 分发物品使用人【L_WH_PROCURE_MODEL_USER】 中 根据id 更新 在用数量(USE_COUNT) |
| | | List<Object[]> procureModelUserIdList = new ArrayList<>(); |
| | | for (Map<String, Object> itemMap : bfModelList) { |
| | | Long procureModelUserId = Convert.toLong(itemMap.get("PROCURE_MODEL_USER_ID")); |
| | | if (procureModelUserId == null) { |
| | | continue; |
| | | } |
| | | Integer counts = Convert.toInt(itemMap.get("COUNTS")); |
| | | |
| | | // StringBuilder sb = new StringBuilder("update L_WH_PROCURE_MODEL_USER set USE_COUNT=USE_COUNT-").append(counts); |
| | |
| | | one[2] = counts; |
| | | procureModelUserIdList.add(one); |
| | | } |
| | | goodsBaseService.execBatchUpdate("update L_WH_PROCURE_MODEL_USER set USE_COUNT=USE_COUNT- ? where id= ? and USE_COUNT- ? >=0", procureModelUserIdList); |
| | | if (!CollectionUtils.isEmpty(procureModelUserIdList)) { |
| | | goodsBaseService.execBatchUpdate("update L_WH_PROCURE_MODEL_USER set USE_COUNT=USE_COUNT- ? where id= ? and USE_COUNT- ? >=0", procureModelUserIdList); |
| | | } |
| | | |
| | | |
| | | //采购、调拨、出库等的物品型号【L_WH_PROCURE_MODEL】中 根据调拨单+型号 更新 在用数量 |