Browse Source

默认有效期

master
han\hanst 3 weeks ago
parent
commit
d781c4307e
  1. 17
      src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java

17
src/main/java/com/gaotao/modules/production/service/impl/ProductionInboundServiceImpl.java

@ -10,6 +10,9 @@ import com.gaotao.common.utils.ErrorLogUtils;
import com.gaotao.common.utils.HttpUtils; import com.gaotao.common.utils.HttpUtils;
import com.gaotao.common.utils.IfsErrorMessageUtils; import com.gaotao.common.utils.IfsErrorMessageUtils;
import com.gaotao.modules.api.entity.IfsShopOrder; import com.gaotao.modules.api.entity.IfsShopOrder;
import com.gaotao.modules.api.entity.issueAndReturnVo.AnInventoryPartInStockVo;
import com.gaotao.modules.api.entity.issueAndReturnVo.InventoryPartVo;
import com.gaotao.modules.api.service.IfsApiIssueAndReturnService;
import com.gaotao.modules.api.service.IfsApiService; import com.gaotao.modules.api.service.IfsApiService;
import com.gaotao.modules.factory.dao.PartAttributeMapper; import com.gaotao.modules.factory.dao.PartAttributeMapper;
import com.gaotao.modules.factory.entity.PartAttribute; import com.gaotao.modules.factory.entity.PartAttribute;
@ -62,7 +65,7 @@ public class ProductionInboundServiceImpl implements ProductionInboundService {
private ProductionInboundMapper productionInboundMapper; private ProductionInboundMapper productionInboundMapper;
@Autowired @Autowired
private IssureNotifyService issureNotifyService;
private IfsApiIssueAndReturnService ifsApiIssueAndReturnService;
@Autowired @Autowired
private HandlingUnitService handlingUnitService; private HandlingUnitService handlingUnitService;
@ -566,7 +569,17 @@ public class ProductionInboundServiceImpl implements ProductionInboundService {
public Map<String, Object> submitShopOrderInbound(ShopOrderInboundDto dto) { public Map<String, Object> submitShopOrderInbound(ShopOrderInboundDto dto) {
log.info("=== 开始生产订单入库 ==="); log.info("=== 开始生产订单入库 ===");
log.info("工单号: {}, 料号: {}, 入库数量: {}", dto.getOrderNo(), dto.getPartNo(), dto.getTransQty()); log.info("工单号: {}, 料号: {}, 入库数量: {}", dto.getOrderNo(), dto.getPartNo(), dto.getTransQty());
if (dto.getIfsExpiryDate() == null) {
List<InventoryPartVo> parts = ifsApiIssueAndReturnService.getInventoryPart(dto.getPartNo(),dto.getSite());
// 如果用户没有选择过期日期则分切物料尝试从IFS获取过期日期成品物料直接设置为当前时间+365天
if (!parts.isEmpty()) {
// 当前时间+365天作为过期日期
Calendar calendar = Calendar.getInstance();
calendar.setTime(new Date());
calendar.add(Calendar.DAY_OF_YEAR, parts.getFirst().getDurabilityDays());
dto.setIfsExpiryDate(calendar.getTime());
}
}
// 用于收集创建的HU unitIds // 用于收集创建的HU unitIds
List<String> unitIds = new ArrayList<>(); List<String> unitIds = new ArrayList<>();

Loading…
Cancel
Save