| | |
| | | package com.aps.core.service.impl; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.aps.common.core.utils.DateUtils; |
| | | import com.aps.core.domain.ApsPlatePlan; |
| | | import com.aps.core.domain.ApsPlateStandardRequire; |
| | | import com.aps.core.mapper.ApsPlatePlanMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.aps.core.mapper.ApsPlateStandardRequireBomOrderDetailMapper; |
| | |
| | | { |
| | | @Autowired |
| | | private ApsPlateStandardRequireBomOrderDetailMapper apsPlateStandardRequireBomOrderDetailMapper; |
| | | |
| | | @Autowired |
| | | private ApsPlatePlanMapper apsPlatePlanMapper; |
| | | /** |
| | | * 查询ApsPlateStandardRequireBomOrderDetail |
| | | * |
| | |
| | | { |
| | | return apsPlateStandardRequireBomOrderDetailMapper.deleteApsPlateStandardRequireBomOrderDetailById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void savePlastPlanAndBomOrderDetail(ApsPlateStandardRequire require, ApsPlatePlan platePlan, BigDecimal subtract, BigDecimal stock, BigDecimal netRequirement) { |
| | | platePlan.setUnmatchedQuantity(subtract); |
| | | apsPlatePlanMapper.updatePlanUnMatchQtyByVersion(platePlan); |
| | | /* 记录工单与净需求的匹配关系*/ |
| | | ApsPlateStandardRequireBomOrderDetail bomOrderDetail = ApsPlateStandardRequireBomOrderDetail.builder() |
| | | .id(IdUtil.getSnowflakeNextId()) |
| | | .requireId(require.getId()) |
| | | .requireTrackId(require.getRequireTrackId()) |
| | | .bomLineId(require.getBomLineId()) |
| | | .bomLineCode(require.getBomLineCode()) |
| | | .docNo(platePlan.getDocumentNumber()) |
| | | .beforeProdAmount(stock) |
| | | .deductionAmount(netRequirement) |
| | | .afterProdAmount(subtract) |
| | | .batchNumber(require.getBatchNumber()) |
| | | .build(); |
| | | apsPlateStandardRequireBomOrderDetailMapper.insertApsPlateStandardRequireBomOrderDetail(bomOrderDetail); |
| | | } |
| | | } |