| | |
| | | |
| | | import cn.hutool.core.convert.Convert; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.service.BaseGoodsModelsServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.BaseGoodsModelsService; |
| | | import com.consum.base.service.BaseWarehouseService; |
| | | import com.consum.base.service.LWhWarningServiceImpl; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.WhWarning; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private LWhWarningServiceImpl lWhWarningService; |
| | | @Resource |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | | private BaseWarehouseService baseWarehouseService; |
| | | @Resource |
| | | private BaseGoodsModelsServiceImpl baseGoodsModelsService; |
| | | private BaseGoodsModelsService baseGoodsModelsService; |
| | | |
| | | /** |
| | | * 当库存变动时调用该方法 |
| | |
| | | return; |
| | | } |
| | | List<Long> allChangModelList = baseModelIdList.stream() |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | baseModelIdList = allChangModelList; |
| | | |
| | | // 将数据插入库存预警【WH_WARNING】 |
| | |
| | | private String KU_CUN_NORMAL_MODEL = "update WH_WARNING set STATES=2 where WAREHOUSE_TYPE=? and BASE_WAREHOUSE_ID=?"; |
| | | |
| | | /** |
| | | * |
| | | * @param warehouseType |
| | | * @param warehouseId |
| | | * @param normalBaseModelIdList 库存正常的 |
| | |
| | | |
| | | StringBuilder sql = new StringBuilder(KU_CUN_NORMAL_MODEL); |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(normalBaseModelIdList)) { |
| | | sql.append(" and BASE_GOODS_MODELS_ID in(").append( org.apache.commons.lang3.StringUtils.join(normalBaseModelIdList, ",")).append(")"); |
| | | sql.append(" and BASE_GOODS_MODELS_ID in(").append(org.apache.commons.lang3.StringUtils.join(normalBaseModelIdList, ",")).append(")"); |
| | | } |
| | | return lWhWarningService.update(sql.toString(), params.toArray()); |
| | | } |