| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.common.core.utils.uuid.IdUtils; |
| | | import com.aps.common.security.utils.DictUtils; |
| | | import com.aps.core.domain.ApsMaterialStorageManagement; |
| | | import com.aps.core.domain.ApsPlatePlan; |
| | | import com.aps.core.domain.ApsPlatePlanTemp; |
| | | import com.aps.core.domain.ApsPlateStandardRequire; |
| | | import com.aps.core.mapper.ApsPartPlanTempMapper; |
| | | import com.aps.core.mapper.ApsPlatePlanMapper; |
| | | import com.aps.core.mapper.ApsPlatePlanTempMapper; |
| | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Hashtable; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | |
| | |
| | | public List<ApsPlatePlan> selectPlateRedundantOrderList(ApsPlatePlan apsPlatePlan) { |
| | | return apsPlatePlanMapper.selectPlateRedundantOrderList(apsPlatePlan); |
| | | } |
| | | |
| | | @Override |
| | | public ApsPlatePlan selectUnMatchPlateSubPlan(String plant, String itemNumber, Hashtable<String, List<ApsPlatePlan>> subPlans) { |
| | | if(subPlans.containsKey(itemNumber)) { |
| | | List<ApsPlatePlan> subPlanList = subPlans.get(itemNumber); |
| | | Optional<ApsPlatePlan> firstPlant = subPlanList.stream().filter(x -> x.getUnmatchedQuantity().compareTo(BigDecimal.ZERO) > 0).findFirst(); |
| | | return firstPlant.orElse(null); |
| | | }else { |
| | | List<ApsPlatePlan> plans = apsPlatePlanMapper.selectUnMatchPlateSubPlanList(plant, itemNumber); |
| | | if (!plans.isEmpty()) { |
| | | subPlans.put(itemNumber, plans); |
| | | return selectUnMatchPlateSubPlan(plant, itemNumber, subPlans); |
| | | } else { |
| | | return null; |
| | | } |
| | | } |
| | | } |
| | | } |