| | |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanDto; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanImportDto; |
| | | import com.ruoyi.productionPlan.dto.ProductionPlanSummaryDto; |
| | | import com.ruoyi.productionPlan.enums.DataSourceTypeEnum; |
| | | import com.ruoyi.productionPlan.mapper.ProductOrderPlanMapper; |
| | | import com.ruoyi.productionPlan.mapper.ProductionPlanMapper; |
| | | import com.ruoyi.productionPlan.pojo.ProductOrderPlan; |
| | |
| | | import java.util.concurrent.locks.ReentrantLock; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import static com.ruoyi.productionPlan.enums.DataSourceTypeEnum.PRODUCTION_FORECAST; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | // å å å©ä½æ¹æ° |
| | | BigDecimal totalRemainingVolume = plans.stream() |
| | | .map(ProductionPlan::getRemainingVolume) |
| | | .filter(v -> v != null) |
| | | .filter(Objects::nonNull) |
| | | .reduce(BigDecimal.ZERO, BigDecimal::add); |
| | | // 夿ä¸åæ°éæ¯å¦å¤§äºçäºå©ä½æ¹æ° |
| | | if (productionPlanDto.getTotalAssignedQuantity().compareTo(totalRemainingVolume) > 0) { |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean add(ProductionPlanDto productionPlanDto) { |
| | | productionPlanDto.setDataSourceType(PRODUCTION_FORECAST.getCode()); |
| | | productionPlanDto.setDataSourceType(DataSourceTypeEnum.MANUAL.getCode()); |
| | | productionPlanDto.setStatus(0); |
| | | productionPlanMapper.insert(productionPlanDto); |
| | | return true; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void syncProdData(Integer dataSyncType) { |
| | | if (!syncLock.tryLock()) { |
| | | log.warn("忥æ£å¨è¿è¡ä¸ï¼æ¬æ¬¡ {} åæ¥è¯·æ±è¢«è·³è¿", dataSyncType == 1 ? "æå¨" : "宿¶ä»»å¡"); |
| | | log.warn("忥æ£å¨è¿è¡ä¸ï¼æ¬æ¬¡ {} åæ¥è¯·æ±è¢«è·³è¿", dataSyncType == 1 ? "æå¨åæ¥" : "宿¶ä»»å¡åæ¥"); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | plan.setFormCreatedTime(parseUtcTime(item.getString("createdTimeGMT"))); |
| | | plan.setFormModifiedTime(parseUtcTime(item.getString("modifiedTimeGMT"))); |
| | | plan.setDataSyncType(dataSyncType); |
| | | plan.setDataSourceType(1); |
| | | plan.setDataSourceType(DataSourceTypeEnum.DING_TALK.getCode()); |
| | | plan.setCreateTime(now); |
| | | plan.setUpdateTime(now); |
| | | plan.setTotalCount(totalCount); |
| | |
| | | entity.setAssignedQuantity(BigDecimal.ZERO); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setDataSourceType(2); |
| | | entity.setDataSyncType(1); |
| | | entity.setDataSourceType(DataSourceTypeEnum.DING_TALK.getCode()); |
| | | |
| | | // æ ¹æ®ç©æç¼ç å¡«å
å
³èID |
| | | if (StringUtils.isNotEmpty(dto.getMaterialCode())) { |